semvec/pypi-packages huggingface dataset:
easy-env 0.1.3
Better environ getter.
License: MIT
Keywords: env,environ

easy_env
========

.. image:: https://travis-ci.org/vaniakosmos/easy_env.svg?master
		:target: https://travis-ci.org/vaniakosmos/easy_env

Implement common operations over env vars such as reading booleans and integers.

Installation
------------

.. code-block:: bash

	pip install easy_env


Usage
-----

.. code-block:: python

	import os
	import easy_env


	# setup env vars
	setup_vars = [
		('int', '42'),
		('float', '42.9'),
		('bool', 'yes'),
		('str', 'foo bar'),
		('bytes', 'Zm9v'),  # base64 encoded b'foo'
		('list', '1,2,3'),
		('list2', '4 5 6'),
	]
	for var, value in setup_vars:
		os.environ[var] = value


	# get var
	assert easy_env.get_int('int') == 42
	assert easy_env.get_float('float') == 42.9
	assert easy_env.get_bool('bool') is True
	assert easy_env.get_str('str') == 'foo bar'
	assert easy_env.get_bytes('bytes') == b'foo'
	assert easy_env.get_list('list') == ['1', '2', '3']

	# get w/ default
	assert easy_env.get_int('NEW_VAR', 5) == 5

	# get w/o default
	assert easy_env.get_int('NEW_VAR') is None

	# get w/o default and raise exception
	try:
		easy_env.get_int('NEW_VAR', raise_error=True)
		assert False
	except KeyError:
		assert True

	# get list of integers
	assert easy_env.get_list('list', item_factory=int) == [1, 2, 3]
	# get list w/ another separator
	assert easy_env.get_list('list2', separator=' ') == ['4', '5', '6']

	# detect type based on type of default
	assert easy_env.get('int', 1) == 42
	assert easy_env.get('int') == '42'
	assert easy_env.get('float', 1.0) == 42.9
	assert easy_env.get('bool', False) is True
	assert easy_env.get('bytes', b'') == b'foo'
	assert easy_env.get('list2', default=[], separator=' ') == ['4', '5', '6']


	# set int
	easy_env.set_int('int_var', 42)
	assert os.getenv('int_var') == '42'

	# set float
	easy_env.set_float('float_var', 42.0)
	assert os.getenv('float_var') == '42.0'

	# set bool
	easy_env.set_bool('bool_var', True)
	assert os.getenv('bool_var') == '1'
	easy_env.set_bool('bool_var', False)
	assert os.getenv('bool_var') == '0'

	# set string
	easy_env.set_str('str_var', 'foo bar')
	assert os.getenv('str_var') == 'foo bar'

	# set bytes
	easy_env.set_bytes('bytes_var', b'foo')
	assert os.getenv('bytes_var') == 'Zm9v'

	# set list
	easy_env.set_list('list_var', [1, 2, 3])
	assert os.getenv('list_var') == '1,2,3'
	easy_env.set_list('list_var', [1, 2, 3], separator=' ')
	assert os.getenv('list_var') == '1 2 3'
	easy_env.set_list('list_var', [1, 2, 3], serializer=lambda x: str(x - 1))
	assert os.getenv('list_var') == '0,1,2'
amvernoncal 0.0.3.dev6
A package that uses natural language processing to convert PDF calendars to JSONs and to convert Google Calendar events to Excel files
License: MIT

Arthur Murray Vernon Machine Learning Calendar
==============================================

This Python package is great for taking Arthur Murray Vernon's Google
Calendar events and arrange them in a calendar structure in an Excel
file. That can then be copy-and-pasted into Microsoft Office Publisher
to create a printable PDF calendar.

For those who want to go from the printable PDF calendars to a digital
one, you're in luck! I use machine learning to parse through printable
PDF calendars and create JSONs out of them, where each event has a
title, dance\_style and time (if applicable), ripe for creating Google
Calendar events from them.

While this project is geared towards use at Arthur Murray Dance Studios,
feel free to take a look at the source code and modify it for your own
calendar's needs.

Have fun!

Setup from source code (GitHub)
-------------------------------
1. Clone the repo.  ``git clone https://github.com/vincentchov/amvernon-cal.git``
2. Install `Python 3.x <https://www.python.org/downloads/>`__ with pip.
3. Install Java 8.
4. Create and activate a virtual environment.
5. Install the corpora ``python -m textblob.download_corpora``.
6. Install dependencies: ``pip install -r requirements.txt``.
7. Profit!

Setup from from PyPI (Pip)
--------------------------

1. Follow steps 2-5 from above.
2. Install amvernoncal from PyPI.  ``pip install amvernoncal``

How to go from Google Calendar to an Excel file
-----------------------------------------------

1. Activate the Google Calendar API for your account and obtain your ``client_secret.json`` file.
2. Activate your virtual environment.
3. Import the module that will use your client secret: ``from amvernoncal.gcal_to_xlsx import gcal_events_to_xlsx``.
4. Give the gcal\_events\_to\_xlsx() function a month and year to search, and the name of the Google
   Calendar you're converting from, making sure to surround each of the two arguments by quotes. 
   Example: ``gcal_events_to_xlsx('September 2017', 'Classes')``
5. That will then create 3 folders: JSONs, PDFs, and Output. Your Excel
   file will be in the Output folder.

Alternatively, you can invoke gcal\_events\_to\_xlsx() directly in the Terminal using ``amvernon_gcal_to_xlsx``,
which comes with a help screen, thanks to Docopt.

How to go from a printable PDF calendar to a JSON
-------------------------------------------------

1. Follow steps 1 and from above.
2. Import the function that will parse your calendar: ``from amvernoncal.pdfproc.pdf_to_json import parse_calendar``
3. Give the parse\_calendar() function a path to your calendar, named
   based on the month and year, as well as tell it if you want to save
   to a JSON file or just return the JSON. 
   Example: ``parse_calendar('september_2017.pdf', to_file=True)``