semvec/pypi-packages huggingface dataset:
timespeaker 0.1.6
Announce the time every hour similar to Mac OS X. Say the Time using Google TTS or espeak.
License: MIT
Requires Python: >=3.6,<4.0

# TimeSpeaker

Announce the time every hour similar to Mac OS X. Say the Time using Google TTS or espeak.

# Requirements

- python3.6+
- playsound
- gtts or pyttsx3

For development

- poetry 
- flake8
- black
- pytest

# TODO

- Use python: [threading.Timer](https://docs.python.org/3/library/threading.html?highlight=timer#threading.Timer)
- Create tests
- Add system tray (opcional) by cli
- Update/Fix to PyPi (`pip install timespeaker`)
- Move Makefile to Parent
- Configure PULL_REQUESTS AND ISSUES template
- Configure lint
- Configure github actions (or circleci)
- Test i3 configs
- Add support to Cron
- Use a global DEBUG
- When merge to `main` build and publish to PyPi (github actions)

# Install

## Default (Working In Progress)

```bash
pip install timespeaker
```

## Local

### On Local User

```bash
# pyenv shell +3.6.0
# asdf shell python +3.6.0

# optional (poetry create a virtualenv for you)
python -m venv .venv 

# install dependencies
make install

# clean old builds
make clean

# build package
make build

# install on local user package (python)
pip install --user dist/{path_from_last_command}.whl
```

**Test local install**
```bash
timespeaker check --speaker gtts
```

# Configure

## AutoStart (Working In Progress)

```bash
make configure-autostart
```

## i3 (Working In Progress)

```bash
make configure-i3
```

## Cron (Working In Progress)

Coming Soon

```bash
sudo make configure-cron
```

## Systemd (Working In Progress)

```bash
sudo make configure-systemd
```

## Remove configurations

```bash
# Systemd
sudo make remove-systemd

# Autostart
make remove-autostart

# i3
# coming soon

# Cron
# coming soon
```

# Usage

Default usage using gtts to speak and saving in `/tmp/timespeaker/`

```bash
# after make install (or poetry install)
poetry run timespeaker start

# OR if configured (local user or via pip install timespeaker)
timespeaker start
```

Custom command:

```bash
poetry run timespeaker start --speaker=pyttsx3 --player=vlc --path-folder=/tmp/timespeaker/
```

## How to check sounds

This speakes sound each 2 second from **midnight** to **23 hours**.

```bash
poetry run timespeaker check-hours-sound gtts
```

# Development

Using virtualenv (python venv):

```bash
# create virtualenv
# virtualenv .venv [-p /path/to/python3.6+] # require virtualenv
python -m venv .venv

# Enter virtualenv
source .venv/bin/activate

# to exit of virtual env run 
deactivate
```

Dev install (poetry required)

```bash
poetry install
```

See more commands with

```bash
make help
```

# Tests

```bash
make test
```

# License

MIT LICENSE

# Contributing

I encourage you to contribute to this project! Join us!

Trying to report a possible security vulnerability? [Open a issue now](https://github.com/wallacesilva/timespeaker/issues/new)

Everyone interacting in this project and its sub-projects' codebases, issue trackers, chat rooms, and mailing lists is expected to follow the code of conduct (building, but respect everyone).
cpntools4py 1.2.2
Support parsing of xml file which export color petri net from CPNTools
License: MIT

# CPNTools4Py

CPNTools4Py is a small python 3 scripts. These scripts support parsing of xml file which export color petri net from CPNTools, 
define a data structure for Petri nets and labelled partial orders.
It is completely open source and be used in academia.

## First Example

A very simple example, to what you appetite:
```py
import cpntools4py
xml_doc = cpntools4py.read_xml('<path_to_xml_file>')
cpn = cpntools4py.CPN(xml_doc)

print(cpn.places) # Get places
```

## Reference

### Module `cpntools4py`
This is CPNTools4Py main module, it holds the various Petrei net elements, arcs, places, transitions.

### Method `cpntools4py.read_xml`
```py
def read_xml(file_path):
```
Read Xml file editing by CPNTools.
```py
xml_doc = read_xml('/path/to/PetriNet.xml')
```
**Call API**
- `str file_path`: Input the XML file of Petri nets editing by CPNTools.
- `return root Element`: Return an object that holds the root element of the node information of CPNTools.

### Method `cpntools4py.to_snakes`
```py
def to_snakes(cpn)
```
Convert to SNAKES from CPNTools
```py
xml_doc = cpntools4py.read_xml('<path_to_xml_file>')
cpn = cpntools4py.CPN(xml_doc)
net = cpntools4py.to_snakes(cpn)
```
**Call API**
- `object CPN`: Input the CPN object.
- `return object net`: return the SNAKES net object.

### Module `cpntools4py.petri_net`
This is CPNTools4Py data structure module, it holds the various Petrei net elements, arcs, places, transitions.

### Class `Place`
A place of a Petri net.
`Place` class has 4 variables, each of which returns `id`, `text`, `type` and `tokens`.
Each variable holds the Place name, color attirbute, and initial marking set by CPNTools. Since id is an identification
number, it is automatically assinged at the time of generation by CPNTools.
```py
xml_doc = cpntools4py.read_xml('<path_to_xml_file>')
cpn = cpntools4py.CPN(xml_doc)

for place in cpn.places:
	print(place.id)
	# 'id0123456789'
```

### Class `Transitions`
A Transition of a Petri net.
`Transition` class has 3 variables, each of which returns `id`, `text` and `time`.
Each variable holds the Transition name and time inscription. id is and identification number.

```py
xml_doc = cpntools4py.read_xml('<path_to_xml_file>')
cpn = cpntools4py.CPN(xml_doc)

for transition in cpn.transitions:
	print(transition.text)
	# 'Trans1'
```

### Class `Arc`
A Arc of a Petri net.
`Arc`　class has 4 variables, each of which returns `id`, `orientation`, `placeend` and `transend`.
The `Arc` class holds the connection information between places and transitions. `orientation` holds the orientation of the arc, `placened` and `tranend` holdes the nodes to be connected.

```py
xml_doc = cpntools4py.read_xml('<path_to_xml_file>')
cpn = cpntools4py.CPN(xml_doc)

for arc in cpn.arcs:
	print(arc.orientation)
	# 'PtoT'
```