interpals-api
This Python library provides a simple HTTP API for working with the website https://interpals.net/. It includes:
- retrieving data by user identifier
- listing visitors
- searching for users by criteria
- viewing users
- listing albums and pictures
Installation
pip install interpals-api
Basic example
from interpals_api import login_sync, ApiSync
session = login_sync('yourusername', 'yourpassword')
api = ApiSync(session)
profile = api.profile('someuser')
print(profile)
Since version 2.1 it supports asynchronous calls for each api method. Below is a brief asynchronous example:
from interpals_api import login_async, ApiAsync
session = await login_async('yourusername', 'yourpassword')
api = ApiAsync(session)
profile = await api.profile('someuser')
print(profile)
Other examples
Basic example to retrieve user info:
from interpals_api import login_sync, ApiSync
session = login_sync('yourusername', 'yourpassword')
api = ApiSync(session)
# This gives info of the user with the link: https://www.interpals.net/someuser
profile = api.profile('someuser')
Dump and load session object:
from interpals_api import login_sync, ApiSync
session = login_sync('yourusername', 'yourpassword')
# Save session into a file
with open('session.txt', 'w') as f:
f.write(session.dumps())
# Load session from the saved file
with open('session.txt') as f:
session = Session.loads(f.read())
Viewing and searching for users:
from interpals_api import login_sync, ApiSync
from interpals_api.schemas import SearchOptions
session = login_sync('yourusername', 'yourpassword')
api = ApiSync(session)
# Viewing a certain user
api.view('someuser')
# Showing the visitors of your profile
users = api.visitors()
print(users)
# Searching for users
options = SearchOptions(
age1=20,
age2=40,
sex=['male', 'female'],
continents=['AF', 'AS', 'EU', 'NA', 'OC', 'SA'],
countries=['US', 'CA', 'UK', 'RU'],
keywords='travelling',
online=True,
city_name='London' # Or you can use 'city_code' with its direct code on the website (it's faster)
)
for user in api.search(options, limit=100, timeout=1.0):
print(user)
To work with pictures, it is necessary to use uid in methods:
from interpals_api import login_sync, ApiSync
session = login_sync('yourusername', 'yourpassword')
api = ApiSync(session)
uid = api.get_uid('someuser')
albums = api.albums(uid)
for album in albums:
pictures = api.pictures(uid, album.aid)
for picture in pictures:
print(picture.large)
Metadata
Release files for interpals-api 3.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| interpals_api-3.0.tar.gz | 13.6 kB | Without provenance | Details for interpals_api-3.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| interpals_api-3.0-py3-none-any.whl | Python 3 | none | any | Details for interpals_api-3.0-py3-none-any.whl |
Total release size: 31.8 kB
Release files / interpals_api-3.0.tar.gz
| Download URL | interpals_api-3.0.tar.gz |
|---|---|
| Size | 13.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0ef8b449233cdbb987b8bcd718879dcc343c0f1e62156fd32417045a0c0a56aa
|
|
BLAKE2b-256 checksum How to use checksums |
98d7ecb441514ffebf25d2af8b2b099d350568f33d5025accf1dc4d1bff41b6a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / interpals_api-3.0-py3-none-any.whl
| Download URL | interpals_api-3.0-py3-none-any.whl |
|---|---|
| Size | 18.1 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7a79036b1010445b0d79365efe81bd747b23f5fe1a2e407740d045471b6f8f01
|
|
BLAKE2b-256 checksum How to use checksums |
a1698a3a1776b07e6a3e69997e27845def28ea255f40c657ac3ab2def9e27b7b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for interpals-api 3.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.