Skip to main content

Python library for 4writers.net automation

Project description

4WritersAPI

Описание

4WritersAPI — это API для взаимодействия с сайтом 4writers.net. Этот инструмент позволяет автоматизировать работу с сайтом, включая авторизацию и получение доступных заказов.


Функционал

  1. Авторизация

    • Выполняется с использованием логина и пароля.
    • Сохраняет сессию для выполнения последующих запросов.
  2. Получение заказов

    • API парсит доступные заказы с сайта и возвращает их в структурированном виде.
    • Поддерживаемая информация:
      • ID заказа.
      • Название.
      • Тема.
      • Дедлайн.
      • Время до выполнения.
      • Тип работы.
      • Уровень академической сложности.
      • Стиль оформления.
      • Язык.
      • Количество страниц.
      • Количество источников.
      • Оплата (зарплата, бонус, общая сумма).

Установка

  1. Убедитесь, что у вас установлен Python 3.8 или выше.
  2. Склонируйте репозиторий:
    git clone https://github.com/your-repo/4writersAPI.git
    cd 4writersAPI
    

Установите зависимости:

pip install -r requirements.txt

Настройка

Создайте файл .env в корне проекта и добавьте ваши учетные данные:

LOGIN=your_login
PASSWORD=your_password

Использование

Пример использования API для авторизации и получения заказов:

import asyncio
from src.api.api import API
from envparse import env

# Загрузка данных из .env файла
env.read_envfile(".env")
LOGIN = env.str("LOGIN")
PASSWORD = env.str("PASSWORD")

# Инициализация API
api = API(login=LOGIN, password=PASSWORD)

async def main():
    # Авторизация
    await api.login()
    
    # Получение заказов
    orders = await api.get_orders()
    
    if not orders:
        print("No orders found.")
    else:
        for order in orders:
            print("=" * 40)
            print(f"Order ID: {order.order_id}")
            print(f"Title: {order.title}")
            print(f"Subject: {order.subject}")
            print(f"Deadline: {order.deadline}")
            print(f"Remaining: {order.remaining}")
            print(f"Order Type: {order.order_type}")
            print(f"Academic Level: {order.academic_level}")
            print(f"Style: {order.style}")
            print(f"Language: {order.language}")
            print(f"Pages: {order.pages}")
            print(f"Sources: {order.sources}")
            print(f"Salary: ${order.salary:.2f}")
            print(f"Bonus: ${order.bonus:.2f}")
            print(f"Total: ${order.total:.2f}")
            print("=" * 40)

asyncio.run(main())

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

py4writers-0.6.1.tar.gz (12.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

py4writers-0.6.1-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file py4writers-0.6.1.tar.gz.

File metadata

  • Download URL: py4writers-0.6.1.tar.gz
  • Upload date:
  • Size: 12.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for py4writers-0.6.1.tar.gz
Algorithm Hash digest
SHA256 b59db0f15786ab47b25ad3a46f84be86c2ca01a04f30dca80822db2b44ebf61c
MD5 445db017216e3fc1542a5a091d68cbb2
BLAKE2b-256 8cef5723716a805949abe48165cf4d75c42518d769ae6e28750cc558ad0a56b3

See more details on using hashes here.

File details

Details for the file py4writers-0.6.1-py3-none-any.whl.

File metadata

  • Download URL: py4writers-0.6.1-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.3 CPython/3.12.3 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for py4writers-0.6.1-py3-none-any.whl
Algorithm Hash digest
SHA256 387eec331b14079e66cc49b90b4c8b7e3b618fd1a71ff5e64b5868d5715a7370
MD5 5eac3f09d26a3ce9a88bebde3eb4ac62
BLAKE2b-256 ba45fd4a7b4251e228c3a83e438d1ba6cf42966b11efbce15764d041235e289c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page