armatis package

Submodules

armatis.models module

class armatis.models.Company(name=None, code=None, phone=None, digit=None)[source]

Bases: object

class armatis.models.Parcel(sender=None, receiver=None, invoice_number=None, address=None, note=None)[source]

Bases: object

class armatis.models.Track(time=None, location=None, status=None, phone1=None, phone2=None)[source]

Bases: object

class armatis.models.Tracker[source]

Bases: object

add_track(new_track)[source]
track_by_status(status)[source]

Find the tracking information matching the status

Parameters:status (str) – The status to find the tracking information
Returns:The tracking information matching the status
tracks

armatis.parser module

class armatis.parser.Parser(invoice_number, config)[source]

Bases: object

add_request(new_request)[source]
add_track(new_track)[source]

Add the tracking status information

Parameters:new_track (Track) – The tracking status information
find()[source]
invoice_number
parcel
parse(parser)[source]

Parse the response of the API request

Parameters:parser – The module for parsing the response
parser(doc)[source]

The module for parsing the response of the API request

Parameters:doc (str) – The response of the API request
Returns:The module for parsing the response
requests
result()[source]

Get the found parcel tracking informations

Returns:The found parcel and tracking informations
Return type:dict
class armatis.parser.ParserManager[source]

Bases: object

register_parser(company, new_parser)[source]

Register the new parser

Parameters:
  • company (Company) – The new company
  • new_parser (Parser) – The new parser
class armatis.parser.ParserRequest(url=None, method=None, body=None, header=None)[source]

Bases: object

class armatis.parser.RequestManager(user_agent)[source]

Bases: object

Provide the additional HTTP request information for browsing the API

add_request(new_request)[source]
class armatis.parser.Source[source]

Bases: object

add_track(new_track)[source]
parcel
summary()[source]
tracks
armatis.parser.dict2parser_request(pr_dict)[source]

Module contents

Armatis

Armatis parses the website or web API response of Korean parcel delivery service company for tracking the parcel.

https://github.com/iBluemind/armatis

class armatis.Armatis(company_code=None, invoice_number=None, config=None)[source]

Bases: object

default_config = {'INVOICE_NUMBER_VALIDATION': False, 'MULTIPLE_REQUEST_PERIOD': 2, 'USER_AGENT_STRING': 'Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; Trident/5.0)'}
find(company_code=None, invoice_number=None)[source]

Track the parcel

Parameters:
  • company_code (str) – The company’s code to find the parcel
  • invoice_number (int) – The invoice number to find the parcel
Returns:

The result of the tracking parcel

Return type:

dict

last_result()[source]

Return the most recent tracking result

Returns:The most recent tracking result
Return type:dict
parser(company_code, invoice_number)[source]

Get the parser for specific company

Parameters:
  • company_code (str) – The company to find the parcel
  • invoice_number (int) – The invoice number to find the parcel
  • validation (bool) – Check the invoice number is valid
Returns:

The parser of the company

supported_companies()[source]

Registered parsers and companies

Returns:The list of company’s name and company’s parser code
Return type:dict