Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/geyang/moleskin
A Debugging and console print utility for python
https://github.com/geyang/moleskin
Last synced: about 2 months ago
JSON representation
A Debugging and console print utility for python
- Host: GitHub
- URL: https://github.com/geyang/moleskin
- Owner: geyang
- Created: 2017-06-13T22:58:17.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2018-05-13T01:40:19.000Z (over 6 years ago)
- Last Synced: 2024-04-24T14:57:53.169Z (8 months ago)
- Language: Python
- Size: 95.7 KB
- Stars: 2
- Watchers: 0
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Moleskin, A Logging Utility for Python Debugging
## Todo
- [ ] Write examples and justify `moleskin`'s existence
- [ ] add pretty pictures of a `mole` and with a notebook.### Done
- [x] rename `ledger` to `moleskin`! because I couldn't get the names:
- `ledger`: because somebody took it.
- `parchment`: because somebody took it (>.<)
- `vellum`: they took the calf version too (o_O )
So I decided on `moleskin`! The paper just gets softer :)
## Installation
```bash
pip install moleskin
```## Usage
```python
from moleskin import MoleskinM = Moleskin()
M.log('this is a log entry!')
# Moleskin gives really nice debug traces:
some_variable = "test"
M.debug(some_variable)# Moleskin can also be used as a code timer:
import time
M.start(silent=True)
time.sleep(3.0)
M.split()
# Lap Time: 3.0084s
```You can even log to a file!
```python
from moleskin import Moleskinmoleskin = Moleskin(file="./a_log_file.log")
moleskin.log('this is a log entry!')
# and it prints to both std out *and* the log file!
```## To Develop
```bash
git clone https://github.com/episodeyang/moleskin.git
cd moleskin
make dev
```To test, run
```bash
make test
```This `make dev` command should build the wheel and install it in your current python environment. Take a look at the [./Makefile](./Makefile) for details.
**To publish**, first update the version number, then do:
```bash
make publish
```