Metadata-Version: 2.4
Name: acidgenomics-syntactic
Version: 0.1.1
Summary: Make syntactically valid names out of strings.
Keywords: naming,case-conversion,syntactic,camelCase,snake_case
Author: Michael Steinbaugh
Author-email: Michael Steinbaugh <mike@steinbaugh.com>
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Text Processing
Classifier: Typing :: Typed
Requires-Dist: bumpver ; extra == 'develop'
Requires-Dist: coverage ; extra == 'develop'
Requires-Dist: interrogate ; extra == 'develop'
Requires-Dist: pyright[nodejs] ; extra == 'develop'
Requires-Dist: pytest ; extra == 'develop'
Requires-Dist: pytest-cov ; extra == 'develop'
Requires-Dist: ruff ; extra == 'develop'
Requires-Dist: ty ; extra == 'develop'
Requires-Dist: uv ; extra == 'develop'
Requires-Dist: myst-parser ; extra == 'docs'
Requires-Dist: numpydoc ; extra == 'docs'
Requires-Dist: sphinx ; extra == 'docs'
Requires-Python: >=3.12
Project-URL: Homepage, https://github.com/acidgenomics/py-syntactic
Project-URL: Documentation, https://python.acidgenomics.com/syntactic/
Project-URL: Repository, https://github.com/acidgenomics/py-syntactic
Project-URL: Changelog, https://github.com/acidgenomics/py-syntactic/blob/main/CHANGELOG.md
Provides-Extra: develop
Provides-Extra: docs
Description-Content-Type: text/markdown

# syntactic

[![Install with Bioconda](https://img.shields.io/badge/install%20with-bioconda-brightgreen.svg)](https://bioconda.github.io/recipes/syntactic/README.html) ![Lifecycle: maturing](https://img.shields.io/badge/lifecycle-maturing-blue.svg)

Make syntactically valid names out of strings.

## Installation

### [uv][] method

This is a [Python][] package hosted on [PyPI][] as `acidgenomics-syntactic`.
The import name is unchanged: `syntactic`.
We recommend using [uv][] to install.

```sh
uv add acidgenomics-syntactic
```

Or with [pip][]:

```sh
pip install acidgenomics-syntactic
```

### [Conda][] method

Configure [Conda][] to use the [Bioconda][] channels.

```sh
# Don't install recipe into base environment.
name='syntactic'
conda create --name="$name" "$name"
conda activate "$name"
python -c 'import syntactic'
```

## Usage

```python
from syntactic import (
    camel_case,
    snake_case,
    kebab_case,
    dotted_case,
    upper_camel_case,
    make_names,
    make_words,
    make_title,
    make_label,
    capitalize,
    sentence_case,
    autopad_zeros,
    syntactic_rename,
)

# Case conversion
snake_case(["human genomeVersion", "sampleID"])
# ['human_genome_version', 'sample_id']

camel_case(["human_genome_version", "sample_id"])
# ['humanGenomeVersion', 'sampleId']

upper_camel_case(["human_genome_version", "sample_id"])
# ['HumanGenomeVersion', 'SampleId']

kebab_case(["human genomeVersion", "sampleID"])
# ['human-genome-version', 'sample-id']

dotted_case(["human genomeVersion", "sampleID"])
# ['human.genome.version', 'sample.id']

# Make syntactically valid names
make_names(["%GC", "1st sample", "hello world"])
# ['GC', 'X1st_sample', 'hello_world']

# Human-readable conversions
make_words(["nGene", "log10GenesPerUMI"])
# ['n gene', 'log10 genes per UMI']

make_title(["nGene", "log10GenesPerUMI"])
# ['N gene', 'Log10 genes per UMI']

# Zero padding
autopad_zeros([1, 10, 100])
# ['001', '010', '100']

# File renaming
syntactic_rename("/path/to/dir", fun="snake_case")
```

## Function Reference

| Python Function    | R Equivalent      | Description                        |
| ------------------ | ----------------- | ---------------------------------- |
| `camel_case`       | `camelCase`       | Convert to lowerCamelCase          |
| `upper_camel_case` | `upperCamelCase`  | Convert to UpperCamelCase          |
| `snake_case`       | `snakeCase`       | Convert to snake_case              |
| `kebab_case`       | `kebabCase`       | Convert to kebab-case              |
| `dotted_case`      | `dottedCase`      | Convert to dotted.case             |
| `make_names`       | `makeNames`       | Make syntactically valid names     |
| `make_dimnames`    | `makeDimnames`    | Apply make_names to name vectors   |
| `make_words`       | `makeWords`       | Convert to human-readable words    |
| `make_title`       | `makeTitle`       | Convert to title case              |
| `make_label`       | `makeLabel`       | Convert to label (sentence) case   |
| `capitalize`       | `capitalize`      | Capitalize first letter per word   |
| `sentence_case`    | `sentenceCase`    | Convert to sentence case           |
| `autopad_zeros`    | `autopadZeros`    | Zero-pad integers/strings          |
| `syntactic_rename` | `syntacticRename` | Rename files with syntactic naming |

## License

Apache-2.0 — Copyright 2026 Acid Genomics LLC — see [LICENSE](LICENSE).

[bioconda]: https://bioconda.github.io/
[conda]: https://docs.conda.io/
[pip]: https://pip.pypa.io/
[pypi]: https://pypi.org/project/acidgenomics-syntactic/
[python]: https://www.python.org/
[uv]: https://docs.astral.sh/uv/
