Skip to content

Commit

Permalink
Merge pull request #20 from thePortus/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
thePortus authored Mar 27, 2018
2 parents b9150f1 + 11235f8 commit 101fa99
Show file tree
Hide file tree
Showing 47 changed files with 2,505 additions and 2,121 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ os: linux
dist: trusty
# set environment variables
env:
- PACKAGE_VERSION=0.0.2
- PACKAGE_VERSION=0.0.4
# install dependencies
install:
- pip install -r requirements/dev.txt
Expand Down
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [0.0.4]

* Changes
* Web module reorganized into main package

## [0.0.3]

* Changes
Expand Down
30 changes: 27 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
---

[![PyPI version](https://badge.fury.io/py/dhelp.svg)](https://badge.fury.io/py/dhelp)
![PyPI - License](https://img.shields.io/pypi/l/Django.svg)
[![Build Status](https://travis-ci.org/thePortus/dhelp.svg?branch=master)](https://travis-ci.org/thePortus/dhelp) [![Coverage Status](https://coveralls.io/repos/github/thePortus/dhelp/badge.svg?branch=master)](https://coveralls.io/github/thePortus/dhelp?branch=master) [![Documentation Status](https://readthedocs.org/projects/dhelp/badge/?version=latest)](http://dhelp.readthedocs.io/en/latest/?badge=latest) [![Code Health](https://landscape.io/github/thePortus/dhelp/master/landscape.svg?style=flat)](https://landscape.io/github/thePortus/dhelp/master) [![Total GitHub downloads](https://img.shields.io/github/downloads/thePortus/dhelp/total.svg)](https://img.shields.io/github/downloads/thePortus/dhelp/total.svg) [![Waffle.io - Columns and their card count](https://badge.waffle.io/thePortus/dhelp.svg?columns=all)](https://waffle.io/thePortus/dhelp)


Expand Down Expand Up @@ -82,7 +81,7 @@ The first time you use a language-specific text object, you need to run its .set
```sh
from dhelp import EnglishText

EnglishText('').setup()
EnglishText.setup()

```

Expand All @@ -103,6 +102,15 @@ single line of code.

from dhelp import TextFile

# quickest method to modify a file, start by making a TextFile object...
txt_file = TextFile('some/file.txt')
# then use with/as syntax to give you the file contents in strings form
with txt_file as txt_data:
# txt_data is contents, whatever you put in txt_file.save_data is saved
txt_file.save_data = txt_data.replace('\n', '')

# Other methods...

# load file data as a string and print to screen
text_file = TextFile('some/file.txt')
text_file.load()
Expand Down Expand Up @@ -146,6 +154,22 @@ TextFile('some/other-file.txt').remove()

from dhelp import TextFolder

# quickest way to modify a folder, start by making a TextFolder object
text_folder = TextFolder('some/path')
# use with/as syntax to get a list of TextFile objects, then loop through
with text_folder as txt_files:
for txt_file in txt_files:
# use with/as syntax on file to get contents
with txt_file as txt_data:
# whatever you store in .save_data will be saved to file
txt_file.save_data = txt_data.replace('\n', '')

```

**Other Methods**

```python

# returns a list of TextFile objects, each connected to a file in the folder
folder_files = TextFolder('some/folder').text_files
# You can loop through and load, edit, save, et.c. the TextFiles as normal
Expand Down Expand Up @@ -291,7 +315,7 @@ Before you use this object for any of the methods below you need to download tra

```python
from dhelp import EnglishText
EnglishText('').setup()
EnglishText.setup()
```

**Examples**
Expand Down
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# General or Current TODO Items

* Revise and add to README.md, provide function-level documentation
* Add with/as context manager to TextFile, TextFolder, and CSVFile

# TODO Items by Module

Expand Down
10 changes: 3 additions & 7 deletions dhelp/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@
manipulations, and even text analysis.
"""

from .files.csv_file import CSVFile
from .files.text_file import TextFile
from .files.text_folder import TextFolder
from .web.web_page import WebPage
from .text.english import EnglishText
from .text.latin import LatinText
from .text.ancient_greek import AncientGreekText
from .files import TextFile, TextFolder, CSVFile
from .web import WebPage
from .text import EnglishText, LatinText, AncientGreekText
3 changes: 3 additions & 0 deletions dhelp/files/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
#!/usr/bin/python

from .txt import TextFile, TextFolder
from .csv import CSVFile
Loading

0 comments on commit 101fa99

Please sign in to comment.