Skip to main content

Modularny konwerter formatów pakietów Python

Project description


title: "Spectomate - Python Package Management Format Converter" description: "A tool for converting projects between different Python package management formats (pip, conda, poetry)" author: "Spectomate Team" keywords: "python, package management, pip, conda, poetry, converter, requirements.txt, environment.yml, pyproject.toml" lang: "en" image: "https://github.com/spectomate/python/raw/main/docs/diagrams/logo.png"

Spectomate

Spectomate is a tool for converting projects between different Python package management formats (pip, conda, poetry).

Key Features of Spectomate:

  1. Modular architecture - each converter is a separate module implementing a common interface
  2. Support for existing tools - ability to integrate with external conversion tools
  3. Flexible extension system - easy addition of new converters without modifying the base code
  4. Comprehensive format support:
    • pip (requirements.txt)
    • conda (environment.yml)
    • poetry (pyproject.toml)

Installation

# Basic installation
pip install spectomate

How to Use Spectomate:

Command Line Interface (CLI)

# Display available converters
spectomate --list

# Convert from pip to conda
spectomate -s pip -t conda -i requirements.txt -o environment.yml --env-name myproject

# Convert from conda to pip
spectomate -s conda -t pip -i environment.yml -o requirements.txt

# Convert from pip to poetry
spectomate -s pip -t poetry -i requirements.txt -o pyproject.toml --project-name "my-project" --version "0.1.0"

Programmatic Usage

from spectomate.converters.pip_to_conda import PipToCondaConverter

# Convert from pip to conda
converter = PipToCondaConverter(
    source_file="requirements.txt",
    target_file="environment.yml",
    options={"env_name": "myproject"}
)
result_path = converter.execute()
print(f"Output file: {result_path}")

Project Structure

spectomate/
├── __init__.py                  # Package initialization
├── cli.py                       # Command line interface
├── core/                        # Core components
│   ├── __init__.py
│   ├── base_converter.py        # Base class for converters
│   ├── registry.py              # Converter registration system
│   └── utils.py                 # Helper functions
├── converters/                  # Converter implementations
│   ├── __init__.py
│   ├── conda_to_pip.py          # Converter from conda to pip
│   ├── pip_to_conda.py          # Converter from pip to conda
│   ├── pip_to_poetry.py         # Converter from pip to poetry
│   └── ...
└── schemas/                     # Data schemas for formats
    ├── __init__.py
    ├── conda_schema.py          # Schema for conda format
    ├── pip_schema.py            # Schema for pip format
    ├── poetry_schema.py         # Schema for poetry format
    └── ...

Documentation

Detailed documentation is available in the docs/ directory:

  • Architecture - description of the system architecture
  • Converters - description of available converters and their implementation
  • Schemas - description of data schemas for different formats

Diagrams

Visual documentation in the form of Mermaid diagrams:

Note: Polish documentation is available in the docs/pl/ directory.

Extending Spectomate

Spectomate is designed as a modular system that can be easily extended with new formats and converters. To add a new converter:

  1. Create a new converter class inheriting from BaseConverter
  2. Implement the required abstract methods:
    • get_source_format() - returns the source format identifier
    • get_target_format() - returns the target format identifier
    • read_source() - reads the source file
    • convert() - converts the data
    • write_target() - writes the data to the target file
  3. Register the converter using the @register_converter decorator

Detailed information on creating custom converters can be found in the converters documentation.

License

This project is licensed under the MIT License. See the LICENSE file for details.

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

spectomate-0.1.47.tar.gz (41.2 kB view details)

Uploaded Source

Built Distribution

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

spectomate-0.1.47-py3-none-any.whl (48.2 kB view details)

Uploaded Python 3

File details

Details for the file spectomate-0.1.47.tar.gz.

File metadata

  • Download URL: spectomate-0.1.47.tar.gz
  • Upload date:
  • Size: 41.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for spectomate-0.1.47.tar.gz
Algorithm Hash digest
SHA256 429947d7723a6334f26b5177d179491357f4f4029fc1457e11b361b3ca39dd83
MD5 abcf5205c3f01d4df00c83c14ac7af00
BLAKE2b-256 bb160021593c6b051aaa913a99a03df54006860a3c637c6c57271371633db7c1

See more details on using hashes here.

File details

Details for the file spectomate-0.1.47-py3-none-any.whl.

File metadata

  • Download URL: spectomate-0.1.47-py3-none-any.whl
  • Upload date:
  • Size: 48.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for spectomate-0.1.47-py3-none-any.whl
Algorithm Hash digest
SHA256 46d62e320f4bdebdaee483044c987f2926982041a6ea55672242f43652e36488
MD5 574accb40c1bf1c76d3d56947f279876
BLAKE2b-256 7c0dea6bbc30a3d317f3c210dd7f7f4dd4a12e2ece139dff419036070c9e5618

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