Skip to main content

CSS generator for Python

Project description

- AthenaCSS -

pypi GitHub license Discord Downloads


Package Details

Details and features

  • A Python package which allows CSS to be written as a Python script
  • CSS output to file, string or console from the Python script

Python Version

  • Supported Python versions: 3.10
    • Other older versions of Python are not currently supported.
    • These older versions will probably not be supported by @AndreasSas himself, but if you want to contribute to the project and make this package compatible with older versions of Python, Pull requests are always welcome.

Quick Examples

The following example is only a very small CSS code piece, but should bring the idea across of how it works.

from AthenaCSS import *
from AthenaColor import RGB # Dependecy on own other package

with (css_generator := CSSGenerator()) as generator:
    with (rule0 := CSSRule()) as (selector, declaration):
        selector.add(
            SelectorElement.H1(CSSClass("title")),
        )
        declaration.add(
            Property.Color(RGB(128,64,32)),
        )
    generator.add_comment(
        "The following sets the Header with the class of 'title' to have a specific color"
    ).add_rule(
        rule0
    )
css_generator.to_console()

The above code will output the following CSS to the console:

/*The following sets the Header with the class of 'title' to have a specific color*/
h1.title {
    color: rgb(128, 64, 32);
}

Documentation

Full documentation can be found at: directiveathena.com (redirect to Obsidian.md publish site) (Reminder, the documentation is still under heavy development)


Install

To install the package in your Python environment

pip install AthenaCSS --upgrade

Links

Project files can be found at:


Disclaimer

With No Dependency, the standard library is not counted as a dependency


Made By Andreas Sas, 2022

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

AthenaCSS-0.8.0.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

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

AthenaCSS-0.8.0-py3-none-any.whl (17.9 kB view details)

Uploaded Python 3

File details

Details for the file AthenaCSS-0.8.0.tar.gz.

File metadata

  • Download URL: AthenaCSS-0.8.0.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.5

File hashes

Hashes for AthenaCSS-0.8.0.tar.gz
Algorithm Hash digest
SHA256 da54433e5614dac318633bd6b0761a1fb02e83201e6d4a78a4401c5972e18af4
MD5 627c556f96e011719162bd5160235218
BLAKE2b-256 ae76f9679c078ed833c82041e48291ba35f40d546de796b29942c5460d4466a8

See more details on using hashes here.

File details

Details for the file AthenaCSS-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: AthenaCSS-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 17.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.0 CPython/3.10.5

File hashes

Hashes for AthenaCSS-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9452acbed314ed375038de286c68d62dd40db6cb2a59eb9992df71b4430197db
MD5 63191030fd390a709e754da079e2329d
BLAKE2b-256 088812080762da81434f24f9b2a780b1c895c638c9e41783a8ba03f0c84a5dc3

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