Getting Started
Installation
Install pyarchiveit using pip or uv:
Initialization
You will need to initialize the ArchiveItAPI class with your account credentials.
It is a better practice to set your credentials as environment variables (.env) and read them in your code instead of hardcoding them. You may use the python-dotenv package to help with this.
Then, create a .env file in your project directory with the following content:
Now, read the environment variables in your code and initialize the ArchiveItAPI client:
import os
from dotenv import load_dotenv
load_dotenv() # (1)!
from pyarchiveit import ArchiveItAPI
archive_it_client = ArchiveItAPI(
account_name=os.getenv('ARCHIVE_IT_ACCOUNT_NAME'),
account_password=os.getenv('ARCHIVE_IT_ACCOUNT_PASSWORD')
)
- The
load_dotenv()function loads the environment variables from the.envfile into the system's environment variables, making them accessible viaos.getenv().
Next Steps
Now that you have initialized the client, you can start using the Archive-it API. Check out the API Reference for available methods and their documentation.