Prepare for PyPi

This commit is contained in:
Jeffrey Serio 2022-09-30 11:53:36 -05:00
parent 52b001e526
commit 4db49a8de2
7 changed files with 40 additions and 22 deletions

View File

@ -2,20 +2,24 @@
This is a little utility I use for logging my daily activities and events. It is written in Python.
Go ahead, make fun of me because this is "cringe". Whatever. I have the basilisks ready to deploy at the snap of my fingers, so you best watch yourself. 😾
## Install
Clone this repo and copy the `elog` binary to PATH somewhere.
Also edit line 32 for your desired elog directory:
```python
elog_dir = Path("~/<your path>/elog").expanduser()
```bash
python3 -m pip install elog
```
## Usage
![usage_screenshot.png](/usage_screenshot.png)
```bash
usage: elog [-h] [-v] {add,edit,rm,ls,lsfiles,search} ...
positional arguments:
{add,edit,rm,ls,lsfiles,search}
options:
-h, --help show this help message and exit
-v, --version Print version information
```
### Example list output
![screenshot.png](/screenshot.png)

3
setup.cfg Normal file
View File

@ -0,0 +1,3 @@
[metadata]
description-file=README.md
license_file=LICENSE

18
setup.py Normal file
View File

@ -0,0 +1,18 @@
from setuptools import setup, find_packages
setup(
name="elog",
version="0.0.2",
license="GPL-3.0",
author="Jeffrey Serio",
author_email="hyperreal@fedoraproject.org",
packages=find_packages("src"),
package_dir={"": "src"},
url="https://github.com/hyperreal64/elog",
keywords="elog",
install_requires=[
"jsonschema",
"rich",
],
)

0
src/elog/__init__.py Normal file
View File

View File

View File

@ -1,18 +1,7 @@
#!/usr/bin/env python3
# USAGE: elog [-h] [-v] {add,edit,rm,ls,lsfiles,search} ...
#
# positional arguments:
# {add,edit,rm,ls,lsfiles,search}
#
# options:
# -h, --help show this help message and exit
# -v, --version Print version information
import argparse
import datetime as dt
import json
import os
import sys
import time
from pathlib import Path
@ -26,10 +15,14 @@ from rich.traceback import install
install(show_locals=True)
VERSION = "0.0.1"
VERSION = "0.0.2"
default_date = dt.date.today().strftime("%Y-%m-%d")
elog_dir = Path("~/Nextcloud/elogs").expanduser()
ELOG_DIR = os.getenv("ELOG_DIR")
if ELOG_DIR is None:
elog_dir = Path("~/elogs").expanduser()
else:
elog_dir = Path(ELOG_DIR)
elog_file = elog_dir.joinpath(default_date + "_elog").with_suffix(".json")

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB