All Projects → bachya → py17track

bachya / py17track

Licence: MIT license
📦 A simple API to track package info from 17track.com

Programming Languages

python
139335 projects - #7 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to py17track

Sro
Friendly Correios SRO API wrapper and command-line utility
Stars: ✭ 7 (-65%)
Mutual labels:  tracking, package
Umbraco Nexu
Umbraco package that let's you track internal links in Umbraco
Stars: ✭ 18 (-10%)
Mutual labels:  tracking, package
cloup
Library to build command line interfaces (CLIs) based on Click. Cloup = Click + option groups, constraints, command aliases, command sections, help themes, "did you mean ...?" suggestions ...
Stars: ✭ 44 (+120%)
Mutual labels:  package
trualias
Mentally computable verification codes for email aliases implemented as a postfix tcp table or milter; uses asyncio.
Stars: ✭ 33 (+65%)
Mutual labels:  asyncio
zomato-analytics-cli
🍔 CLI for showing basic stats of Zomato orders
Stars: ✭ 23 (+15%)
Mutual labels:  package
idataapi-transform
Full async support toolkit for IDataAPI for efficiency work, read data from API/ES/csv/xlsx/json/redis/mysql/mongo/kafka, write to ES/csv/xlsx/json/redis/mysql/mongo/kafka, provide CLI and python API
Stars: ✭ 36 (+80%)
Mutual labels:  asyncio
swetrix-js
The JavaScript analytics client for Swetrix Analytics
Stars: ✭ 28 (+40%)
Mutual labels:  tracking
secure compare
A secure compare for Elixir.
Stars: ✭ 17 (-15%)
Mutual labels:  package
laravel-livewire-ui
Laravel Livewire UI, Auth, & CRUD starter kit.
Stars: ✭ 92 (+360%)
Mutual labels:  package
distex
Distributed process pool for Python
Stars: ✭ 101 (+405%)
Mutual labels:  asyncio
aioaria2
An async/await wrapper around aria2-json-rpc with websocket support
Stars: ✭ 20 (+0%)
Mutual labels:  asyncio
outbound-go
URL shortener and Redirection As A Service
Stars: ✭ 21 (+5%)
Mutual labels:  tracking
repology-webapp
Repology web application
Stars: ✭ 114 (+470%)
Mutual labels:  package
laravel-conditional-providers
THIS PACKAGE HAS BEEN DEPRECATED — Load Laravel service providers and facades based on the current environment.
Stars: ✭ 26 (+30%)
Mutual labels:  package
abjutils
Useful functions for the Brazilian Jurimetrics Association
Stars: ✭ 42 (+110%)
Mutual labels:  package
asyncqlio
A fully async ORM for Python 3.5+
Stars: ✭ 25 (+25%)
Mutual labels:  asyncio
trex
TRex, a fast multi-animal tracking system with markerless identification, and 2D estimation of posture and visual fields.
Stars: ✭ 46 (+130%)
Mutual labels:  tracking
foosball
Analysis of table soccer games based on video recordings
Stars: ✭ 22 (+10%)
Mutual labels:  tracking
website
PySlackers website for invites and learning resources
Stars: ✭ 61 (+205%)
Mutual labels:  asyncio
nardis
A small web framework based on ASGI
Stars: ✭ 14 (-30%)
Mutual labels:  asyncio

📦 py17track: A Simple Python API for 17track.net

CI PyPi Version License Code Coverage Maintainability Say Thanks

py17track is a simple Python library to track packages in 17track.net accounts.

Since this is uses an unofficial API, there's no guarantee that 17track.net will provide every field for every package, all the time. Additionally, this API may stop working at any moment.

Python Versions

py17track is currently supported on:

  • Python 3.6
  • Python 3.7
  • Python 3.8
  • Python 3.9
  • Python 3.10

Installation

pip install py17track

Usage

import asyncio

from aiohttp import ClientSession

from py17track import Client


async def main() -> None:
    """Run!"""
    client = Client()

    # Login to 17track.net:
    await client.profile.login('<EMAIL>', '<PASSWORD>')

    # Get the account ID:
    client.profile.account_id
    # >>> 1234567890987654321

    # Get a summary of the user's packages:
    summary = await client.profile.summary()
    # >>> {'In Transit': 3, 'Expired': 3, ... }

    # Get all packages associated with a user's account:
    packages = await client.profile.packages()
    # >>> [py17track.package.Package(..), ...]
    
    # Add new packages by tracking number
    await client.profile.add_package('<TRACKING NUMBER>', '<FRIENDLY NAME>')


asyncio.run(main())

By default, the library creates a new connection to 17track with each coroutine. If you are calling a large number of coroutines (or merely want to squeeze out every second of runtime savings possible), an aiohttp ClientSession can be used for connection pooling:

import asyncio

from aiohttp import ClientSession

from py17track import Client


async def main() -> None:
    """Run!"""
    async with ClientSession() as session:
        client = Client(session=session)

        # ...


asyncio.run(main())

Each Package object has the following info:

  • destination_country: the country the package was shipped to
  • friendly_name: the human-friendly name of the package
  • info: a text description of the latest status
  • location: the current location (if known)
  • timestamp: the timestamp of the latest event
  • origin_country: the country the package was shipped from
  • package_type: the type of package (if known)
  • status: the overall package status ("In Transit", "Delivered", etc.)
  • tracking_info_language: the language of the tracking info
  • tracking_number: the all-important tracking number

Contributing

  1. Check for open features/bugs or initiate a discussion on one.
  2. Fork the repository.
  3. (optional, but highly recommended) Create a virtual environment: python3 -m venv .venv
  4. (optional, but highly recommended) Enter the virtual environment: source ./.venv/bin/activate
  5. Install the dev environment: script/setup
  6. Code your new feature or bug fix.
  7. Write tests that cover your new functionality.
  8. Run tests and ensure 100% code coverage: script/test
  9. Update README.md with any new documentation.
  10. Add yourself to AUTHORS.md.
  11. Submit a pull request!
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].