Modularny konwerter formatów pakietów Python
Project description
Spectomate
Spectomate is a tool for converting projects between different Python package management formats (pip, conda, poetry).
Key Features of Spectomate:
- Modular architecture - each converter is a separate module implementing a common interface
- Support for existing tools - ability to integrate with external conversion tools
- Flexible extension system - easy addition of new converters without modifying the base code
- 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:
- Architecture Diagram - class structure and relationships between components
- Data Flow Diagram - data flow during the conversion process
- Sequence Diagram - interactions between components during conversion
- Extension Diagram - process of adding new converters and formats
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:
- Create a new converter class inheriting from
BaseConverter - Implement the required abstract methods:
get_source_format()- returns the source format identifierget_target_format()- returns the target format identifierread_source()- reads the source fileconvert()- converts the datawrite_target()- writes the data to the target file
- Register the converter using the
@register_converterdecorator
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
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
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
File details
Details for the file spectomate-0.1.37.tar.gz.
File metadata
- Download URL: spectomate-0.1.37.tar.gz
- Upload date:
- Size: 34.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c16a2872f54a4af998f3ae2683835f40c118cbd747d3076ff0b167fccb93226
|
|
| MD5 |
f1a38f8be48df3c79f0756a9260f369b
|
|
| BLAKE2b-256 |
e793c67b842f16d4f634c46cd753cee0b702aa54e0c70f286b6a0281bb3747e8
|
File details
Details for the file spectomate-0.1.37-py3-none-any.whl.
File metadata
- Download URL: spectomate-0.1.37-py3-none-any.whl
- Upload date:
- Size: 41.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92c485adb8b7d7e3bb271daa9af8ed2a63f9fc06481ff18acc78b53ce5341ec3
|
|
| MD5 |
4219142206bf4cc4b8c444f521d0d9e9
|
|
| BLAKE2b-256 |
b9f57f56bdf4db740a6a8f1aa26ace77f1828a578a69f09c7ccd2485078a4ebd
|