Python SDK for the LetIt API
Project description
LetIt Python
The official Python SDK for the LetIt API.
Installation
pip install letit
Setup
Find your API token at https://letit.com/settings/developer after creating an account at https://letit.com/register.
from letit import LetIt
client = LetIt(api_token="your_api_token_here")
Usage
Create a micropost
from letit.schemas.micropost import PostType
# Text post
post = client.micropost.client_create_micropost(
title="Hello World",
body="This is my first post.",
)
print(post.public_id)
print(post.link)
# Media post
with open("photo.png", "rb") as f:
post = client.micropost.client_create_micropost(
title="My photo",
body="Check this out",
post_type=PostType.MEDIA,
file=("photo.png", f, "image/png"),
)
Create a job post
from letit.schemas.job import JobLocation, JobType, JobCategory, JobExperienceLevel
job = client.job.client_create_user_job_with_company(
company_name="LetIt",
company_description="We build things.",
company_website="https://letit.com",
job_title="Rust Engineer",
job_description="Build backend services in Rust.",
job_how_to_apply="https://letit.com/careers",
job_location=JobLocation.REMOTE,
job_type=JobType.FULLTIME,
job_category=JobCategory.PROGRAMMING,
job_experience_level=JobExperienceLevel.SENIOR,
job_skills="Rust, SQL",
)
print(job.slug)
API Reference
LetIt(api_token, base_url?)
| Parameter | Type | Description |
|---|---|---|
api_token |
str |
Your API token |
base_url |
str |
API base URL (default: https://api.letit.com) |
client.micropost.client_create_micropost(...)
| Parameter | Type | Default | Description |
|---|---|---|---|
body |
str |
required | Content of the post |
title |
str |
None |
Required for original posts |
post_type |
PostType |
PostType.TEXT |
PostType.TEXT or PostType.MEDIA |
community_name |
str |
None |
Community to post in |
parent_micropost_public_id |
str |
None |
For replies |
parent_micropost_comment_public_id |
str |
None |
For nested replies |
allow_comments |
bool |
True |
Whether comments are allowed |
is_draft |
bool |
False |
Save as draft |
file |
tuple |
None |
(filename, file_object, mime_type) for MEDIA posts |
client.job.client_create_user_job_with_company(...)
| Parameter | Type | Default | Description |
|---|---|---|---|
company_name |
str |
required | Name of the company |
company_description |
str |
required | Description of the company |
company_website |
str |
required | Company website URL |
job_title |
str |
required | Title of the job |
job_description |
str |
required | Full job description |
job_how_to_apply |
str |
required | URL or instructions to apply |
company_logo |
tuple |
None |
(filename, file_object, mime_type) |
company_location |
str |
None |
Company location |
job_location |
JobLocation |
JobLocation.REMOTE |
REMOTE, ONSITE, HYBRID |
job_type |
JobType |
JobType.FULLTIME |
FULLTIME, PARTTIME, CONTRACT, FREELANCE, INTERNSHIP |
job_category |
JobCategory |
JobCategory.PROGRAMMING |
PROGRAMMING, BLOCKCHAIN, DESIGN, MARKETING, CUSTOMERSUPPORT, WRITING, PRODUCT, SERVICE, HUMANRESOURCE, ELSE |
job_experience_level |
JobExperienceLevel |
JobExperienceLevel.ALL |
ALL, JUNIOR, MID, SENIOR, NOEXPERIENCEREQUIRED |
job_minimum_salary |
int |
None |
Minimum salary |
job_maximum_salary |
int |
None |
Maximum salary |
job_pay_in_cryptocurrency |
bool |
False |
Pay in cryptocurrency |
job_skills |
str |
None |
Comma-separated skills |
Development
# Install in editable mode
pip install -e .
# Run unit tests
python -m pytest letit/tests/test_letit.py -v
# Run integration tests (requires real API token)
LETIT_API_TOKEN=your_token python -m pytest letit/tests/test_letit_integration.py -v -s
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
letit-0.0.1.tar.gz
(8.2 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
letit-0.0.1-py3-none-any.whl
(10.2 kB
view details)
File details
Details for the file letit-0.0.1.tar.gz.
File metadata
- Download URL: letit-0.0.1.tar.gz
- Upload date:
- Size: 8.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5f0d3232c5542e617fc4197f457d63dc1d169e380d2b966bf036841d7ef564d1
|
|
| MD5 |
3083c2e010994fcd6a9d964cbbdf521b
|
|
| BLAKE2b-256 |
6d4cbd21235afb3c2675a7e93f8b4b84ae2cc3cd35421f11132a09b7717ebb8c
|
File details
Details for the file letit-0.0.1-py3-none-any.whl.
File metadata
- Download URL: letit-0.0.1-py3-none-any.whl
- Upload date:
- Size: 10.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b247325c7a63ef401a3e75ffe33cf7db729fcd6115db421c90f87b2faea89b22
|
|
| MD5 |
538ea1dbc7836b3ad57b937eddeef7a9
|
|
| BLAKE2b-256 |
abce86f0bc7fd43135ee533707d6af98c3eaa00f2f6f6ed3ab4a72dc53d7b928
|