Async Python wrapper for the AfterShip API
python3 -m pip install pyaftership
Here is an example of what you can do, more examples can be found in the tests
directory.
import asyncio
import aiohttp
from pyaftership import AfterShip
API_KEY = 'XXXXXXXX0000000000XXXXXXXX0000000XXXXX000'
async def example():
"""Get trackings."""
async with aiohttp.ClientSession() as session:
aftership = AfterShip(API_KEY, session)
trackings = await aftership.trackings.list()
print("Pending trackings:", trackings["trackings"])
asyncio.get_event_loop().run_until_complete(example())
All contributions are welcome!
- Fork the repository
- Clone the repository locally and open the devcontainer or use GitHub codespaces
- Do your changes
- Lint the files with
scripts/lint
- Ensure all tests passes with
scripts/test
- Ensure 100% coverage with
scripts/coverage
- Commit your work, and push it to GitHub
- Create a PR against the
main
branch