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.1.tar.gz (14.9 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.1-py3-none-any.whl (15.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyojure-0.2.1.tar.gz
  • Upload date:
  • Size: 14.9 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.1.tar.gz
Algorithm Hash digest
SHA256 e6acb0ab5097adf89abe4768a087496874e441e27bb997686c7e722273cda1e9
MD5 b8c1ac29883268abbdc6bcf6aa020334
BLAKE2b-256 2a418886600444e73fa03a40a10df7992f89bcf96b5f2170e81959f653df1f94

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyojure-0.2.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: pyojure-0.2.1-py3-none-any.whl
  • Upload date:
  • Size: 15.2 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 d6d7e07c1617d45693a8066adcef051b73559a8b2de7c7c842d2407b6d1bc093
MD5 b3b80ff81d4251ef4f8a90f442bf3ec9
BLAKE2b-256 ee888d8b61e21b79aac8e1d6a0b2e6dbb7d51d0907a00e211b8e43be391b2e8d

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyojure-0.2.1-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