AccessONIX
December 3, 2024 · View on GitHub
AccessONIX is a web application that generates ONIX 3.0 XML files for accessible EPUB formats. It analyzes EPUB files for accessibility features and combines them with existing ONIX data to create complete, standards-compliant ONIX files.
Features
- Single-step EPUB accessibility analysis and ONIX generation
- Support for both Production and Publisher roles
- Complete ONIX 3.0 compatibility
- Automated accessibility feature detection
- Publisher information management
- Pricing information in multiple currencies
- Memory-optimized file processing
- Comprehensive error handling and validation
Installation
- Clone the repository:
git clone https://github.com/yourusername/accessonix.git
cd accessonix
- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
- Install dependencies:
pip install -r requirements.txt
- Set up environment variables:
cp .env.example .env
# Edit .env with your settings
Local Development
- Start the development server:
flask run
- Visit
http://localhost:5000in your browser
Heroku Deployment
- Install Heroku CLI and login:
heroku login
- Create a new Heroku app:
heroku create your-app-name
- Set environment variables:
heroku config:set FLASK_APP=app.main
heroku config:set FLASK_ENV=production
heroku config:set SECRET_KEY=your-secret-key
- Deploy:
git push heroku main
Usage
Production Role
- Upload EPUB file
- Upload source ONIX XML
- Enter EPUB ISBN
- Generate ONIX file
Publisher Role
- Upload EPUB file
- Upload source ONIX XML
- Enter EPUB ISBN
- Provide publisher information:
- Sender details
- Contact information
- Product details
- Pricing information
- Generate ONIX file
File Requirements
- EPUB files must be properly formatted and contain accessibility metadata
- ONIX XML files must be valid XML
- Maximum file size: 16MB
- ISBN must be 13 digits
Directory Structure
accessonix/
├── app/
│ ├── __init__.py
│ ├── main.py
│ ├── config.py
│ ├── utils/
│ │ ├── __init__.py
│ │ ├── epub_analyzer.py
│ │ ├── onix_processor.py
│ │ ├── memory_utils.py
│ │ └── validators.py
│ ├── static/
│ │ ├── css/
│ │ ├── js/
│ │ └── images/
│ └── templates/
│ ├── base.html
│ ├── index.html
│ ├── help.html
│ └── error.html
├── logs/
├── tests/
├── .env
├── .gitignore
├── Procfile
├── README.md
├── requirements.txt
└── runtime.txt
Testing
Run tests using:
python -m pytest tests/
Contributing
- Fork the repository
- Create your feature branch:
git checkout -b feature/my-new-feature - Commit your changes:
git commit -am 'Add some feature' - Push to the branch:
git push origin feature/my-new-feature - Submit a pull request
License
© desLibris Publishing Solutions. All rights reserved.
Support
For support, please contact [support email].