Skip to main content

Make Python More Like Clojure

Project description

pyojure

make python more like clojure

pyojure is pure joy

Usage

>>> from pyojure import *
>>> mapv(print, dir())
>>> assoc({"this": "is"}, "very", "cool")
{'this': 'is', 'very': 'cool'}
>>> comp(str, inc, int)('123')
'124'
>>> list(partition(2, [1,2,3,4,5,6,7,8,9]))
[[1, 2], [3, 4], [5, 6], [7, 8], [9]]

Doc

>>> import pyojure
>>> help(pyojure.core)

Caveats

  • Clojure has much more liberal syntax for identifiers. Standard naming transpositions are attempted.
    • - -> _ e.g. every-pred -> every_pred
    • ? predicate suffix -> is_/has_/etc. predicate prefix e.g., odd? -> is_odd
  • Some Clojure function names indicate types that are known by different names in Python.
    • E.g., the v in mapv refers to the Clojure vector type, which is equivalent to a Python list
    • Both names are provided for now i.e., mapv == mapl

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

pyojure-0.2.0.tar.gz (14.8 kB view details)

Uploaded Source

Built Distribution

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

pyojure-0.2.0-py3-none-any.whl (15.1 kB view details)

Uploaded Python 3

File details

Details for the file pyojure-0.2.0.tar.gz.

File metadata

  • Download URL: pyojure-0.2.0.tar.gz
  • Upload date:
  • Size: 14.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pyojure-0.2.0.tar.gz
Algorithm Hash digest
SHA256 64c169890f224e4cf4eaddf523065fe474120c192544d99b388662af57687e81
MD5 17648bd94bdc1fea674303f87f66f489
BLAKE2b-256 824395e1ee13d851bf29333833ae6bdbd5495fce8d12ce9d5e9c98e73e16facd

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyojure-0.2.0.tar.gz:

Publisher: publish-to-test-pypi.yml on superwesman/pyojure

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file pyojure-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pyojure-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 15.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for pyojure-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c409961bed82ba94706640a45921bd163c8d0f8d31422128dfe9cc8e978e71fd
MD5 3d14dae2c56e1f8c3b924a381e3ab057
BLAKE2b-256 d679c18fa31a6144a3c1584f5378052df80734a3a75a1c0391ade5d746522b6d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyojure-0.2.0-py3-none-any.whl:

Publisher: publish-to-test-pypi.yml on superwesman/pyojure

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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