Skip to content

Commit

Permalink
Update project name (#80)
Browse files Browse the repository at this point in the history
## Associated issue number and/or pull request reference
Fixes #70

## Proposed solution to the issue
Changed all namespace from Pandarize to bibReader
Updated readme.md
Updated tutorial notebooks
  • Loading branch information
jshinm authored Feb 13, 2023
2 parents 865371e + 7f0cebb commit 66e9bcc
Show file tree
Hide file tree
Showing 11 changed files with 321 additions and 317 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ on:
pull_request:
types: [closed]
paths:
- 'pandarize/__init__.py'
- 'bibReader/__init__.py'
jobs:
deploy:
runs-on: ubuntu-latest
Expand Down
21 changes: 9 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,18 @@
# Pandarize
This project aims to turn all kinds of data structure/types into a nice tabulated pandas DataFrame
[![PyPI](https://github.com/jshinm/pandarize/actions/workflows/publish-package.yml/badge.svg)](https://github.com/jshinm/pandarize/actions/workflows/publish-package.yml)
# bibReader
The bibReader reads non-standard bib format from files/url and convert them into pandas DataFrames to easily work with the data, and then tranforms them back into a standardized bib file.

# Installation
```
pip install pandarize
pip install bibReader
```

# Basic Usage Guide
```python
from pandarize.frame import Pandarizer
from bibReader.frame import bReader

pdr = Pandarizer() #instantiate Pandarizer class
pdr.load(source='https://somewebsite.com/filename.bib') #it can load from url or local source
pdr.fit() #infers data types and parse it into pandas dataframe
pdr.transform() #changes pandas dataframe into different mode of data types
bib = bReader() #instantiate bReader class
bib.load(source='https://somewebsite.com/filename.bib') #it can load from url or local source
bib.fit() #infers data types and parse it into pandas dataframe
bib.transform() #changes pandas dataframe into different mode of data types
```

# Currently Supported Data Types
- bib

File renamed without changes.
7 changes: 4 additions & 3 deletions pandarize/_util.py → bibReader/_util.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from datetime import datetime
import re
import bibReader

def rfindall(string, pattern):
'''Find index of all occurrence of the pattern'''
Expand Down Expand Up @@ -62,13 +63,13 @@ def check_url(string):

return False

def stamper(target, name, url, marker='%'):
def stamper(target, marker='%'):
'''Creates head stamp on the transformed dataframe
'''
msg = f'{marker}'*60 + '\n'
msg += f'{marker} This {target} file is created and processed by {name}\n'
msg += f'{marker} This {target} file is created and processed by bibReader-{bibReader.__version__}\n'
msg += f'{marker} Date: {datetime.today().date()}\n'
msg += f'{marker} Webpage: {url}\n'
msg += f'{marker} Webpage: https://github.com/jshinm/bibReader/\n'
msg += f'{marker}'*60 + '\n\n'

return msg
Expand Down
File renamed without changes.
2 changes: 1 addition & 1 deletion pandarize/frame.py → bibReader/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
from .loader import Loader
from .parser import Parser

class Pandarizer(Loader, Parser):
class bReader(Loader, Parser):

def __init__(self):
self.initialize()
Expand Down
File renamed without changes.
File renamed without changes.
49 changes: 24 additions & 25 deletions examples/ndd_member_update.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
{
"data": {
"text/plain": [
"'0.0.8.7'"
"'0.0.8.12'"
]
},
"execution_count": 1,
Expand All @@ -25,10 +25,10 @@
}
],
"source": [
"from pandarize.frame import Pandarizer\n",
"from bibReader.frame import bReader\n",
"import pandas as pd\n",
"import pandarize\n",
"pandarize.__version__"
"import bibReader\n",
"bibReader.__version__"
]
},
{
Expand All @@ -45,8 +45,7 @@
}
],
"source": [
"pdr = Pandarizer()\n",
"pdr.initialize()"
"bib = bReader()"
]
},
{
Expand All @@ -55,8 +54,8 @@
"metadata": {},
"outputs": [],
"source": [
"pdr.settings['convert_names'] = False\n",
"pdr.settings['remove_empty_entries'] = False"
"bib.settings['convert_names'] = False\n",
"bib.settings['remove_empty_entries'] = False"
]
},
{
Expand All @@ -65,8 +64,8 @@
"metadata": {},
"outputs": [],
"source": [
"pdr.load('https://raw.githubusercontent.com/neurodata/neurodata.io/deploy/content/bibs/people.bib')\n",
"pdr.fit()"
"bib.load('https://raw.githubusercontent.com/neurodata/neurodata.io/deploy/content/bibs/people.bib')\n",
"bib.fit()"
]
},
{
Expand Down Expand Up @@ -186,7 +185,7 @@
" <td>09/20 –</td>\n",
" <td></td>\n",
" <td>Currently investigating the effect of inductiv...</td>\n",
" <td>MS</td>\n",
" <td>MSE</td>\n",
" <td>BME, JHU</td>\n",
" <td>staff</td>\n",
" <td>staffresearch</td>\n",
Expand Down Expand Up @@ -265,7 +264,7 @@
" abstract userb \\\n",
"0 \n",
"1 \n",
"2 Currently investigating the effect of inductiv... MS \n",
"2 Currently investigating the effect of inductiv... MSE \n",
"3 Developed Sparse Projection Oblique Randomer F... MSE \n",
"4 Javier studies how larval zebrafish learn how ... Ph.D. \n",
"\n",
Expand All @@ -290,7 +289,7 @@
}
],
"source": [
"pdr.df.head()"
"bib.df.head()"
]
},
{
Expand All @@ -299,7 +298,7 @@
"metadata": {},
"outputs": [],
"source": [
"pdr.df.to_excel(filepath, index=False, engine='xlsxwriter')"
"bib.df.to_excel(filepath, index=False, engine='xlsxwriter')"
]
},
{
Expand All @@ -315,7 +314,7 @@
"metadata": {},
"outputs": [],
"source": [
"# pdr.df = pd.read_excel(ufilepath, dtype=object, na_filter=False)"
"bib.df = pd.read_excel(ufilepath, dtype=object, na_filter=False)"
]
},
{
Expand Down Expand Up @@ -425,13 +424,13 @@
" <td>09/20 –</td>\n",
" <td></td>\n",
" <td>Currently investigating the effect of inductiv...</td>\n",
" <td>MS</td>\n",
" <td>MSE</td>\n",
" <td>BME, JHU</td>\n",
" <td>staff</td>\n",
" <td>staffresearch</td>\n",
" <td>jshinm</td>\n",
" <td>jshin69@jhu.edu</td>\n",
" <td></td>\n",
" <td>modrev.org/jshinm</td>\n",
" <td>safe-zone</td>\n",
" <td>jong_shin.png</td>\n",
" <td>2.0</td>\n",
Expand Down Expand Up @@ -504,7 +503,7 @@
" abstract userb \\\n",
"0 \n",
"1 \n",
"2 Currently investigating the effect of inductiv... MS \n",
"2 Currently investigating the effect of inductiv... MSE \n",
"3 Developed Sparse Projection Oblique Randomer F... MSE \n",
"4 Javier studies how larval zebrafish learn how ... Ph.D. \n",
"\n",
Expand All @@ -518,7 +517,7 @@
" url usere file priority \n",
"0 neurodata.io/about/jovo/ safe-zone vogelstein_joshua.jpg 0.0 \n",
"1 priebe_carey.jpg 1.0 \n",
"2 safe-zone jong_shin.png 2.0 \n",
"2 modrev.org/jshinm safe-zone jong_shin.png 2.0 \n",
"3 tomita_tyler.jpg 3.0 \n",
"4 safe-zone javier_how.jpg 3.0 "
]
Expand All @@ -529,26 +528,26 @@
}
],
"source": [
"pdr.df.head(5)"
"bib.df.head(5)"
]
},
{
"cell_type": "code",
"execution_count": 10,
"execution_count": 11,
"metadata": {},
"outputs": [],
"source": [
"pdr.df.priority = pdr.df.priority.astype(float)\n",
"pdr.df.sort_values(['priority'], ascending=True, inplace=True)"
"bib.df.priority = bib.df.priority.astype(float)\n",
"bib.df.sort_values(['priority'], ascending=True, inplace=True)"
]
},
{
"cell_type": "code",
"execution_count": 11,
"execution_count": 12,
"metadata": {},
"outputs": [],
"source": [
"pdr.transform(filename='people')"
"bib.transform(filename='people')"
]
},
{
Expand Down
Loading

0 comments on commit 66e9bcc

Please sign in to comment.