Skip to content

Commit

Permalink
Merge pull request #356 from RavirajBaraiya/pip_zingg
Browse files Browse the repository at this point in the history
zingg pip package artifacts modification
  • Loading branch information
sonalgoyal authored Jun 21, 2022
2 parents 0505542 + da59ab1 commit a806efa
Show file tree
Hide file tree
Showing 17 changed files with 1,249 additions and 47 deletions.
661 changes: 661 additions & 0 deletions python/LICENSE

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions python/MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
global-exclude *.py[cod] __pycache__ .DS_Store *.pyc
recursive-include deps/jars *.jar
graft deps/scripts
recursive-include deps/scripts zingg.sh
recursive-include deps/licenses LICENSE
recursive-include deps/examples *
recursive-include deps/models *
recursive-include deps/phases *
recursive-include deps/config *
recursive-include lib *.zip
include *.py
include LICENSE
include README.md
include requirements.txt
28 changes: 28 additions & 0 deletions python/PKG-INFO
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
Metadata-Version: 2.1
Name: zingg
Version: 0.3.4
Summary: Zingg.ai Entity Resolution
Home-page: www.zingg.ai
Author: Zingg.AI
Author-email: [email protected]
License: UNKNOWN
Description: ## About Zingg

Zingg is an ML based entity resolution framework. The Python Package is used for building training data, training Zingg models and running the matching and linking processes.
[Zingg.AI](https://www.zingg.ai)

# requirement
python 3.6+; spark 3.1.2

# Installation

```
pip install zingg
```


Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: GNU Affero General Public License v3
Classifier: Operating System :: OS Independent
Description-Content-Type: text/markdown
File renamed without changes.
8 changes: 0 additions & 8 deletions python/api/MANIFEST.in

This file was deleted.

73 changes: 73 additions & 0 deletions python/install.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import os
import re
import tarfile
import traceback
import urllib.request
from shutil import rmtree

def checked_package_name(zingg_version):
"""
Check the generated package name.
"""
return "%s" % (zingg_version)

def checked_versions(zingg_version):
"""
Check the valid combinations of supported versions in zingg distributions.
Parameters
----------
zingg_version : str
zingg version. It should be X.X.X such as '3.0.0' or zingg-3.0.0.
"""
if re.match("^[0-9]+\\.[0-9]+\\.[0-9]+$", zingg_version):
zingg_version = "zingg-%s" % zingg_version
if not zingg_version.startswith("zingg-"):
raise RuntimeError(
"zingg version should start with 'zingg-' prefix; however, " "got %s" % zingg_version
)

return zingg_version

def install_zingg(dest, zingg_version):
"""
Installs zingg that corresponds to the given Hadoop version in the current
library directory.
Parameters
----------
dest : str
The location to download and install the zingg.
zingg_version : str
zingg version. It should be zingg-X.X.X form.
"""

package_name = checked_package_name(zingg_version)
package_local_path = os.path.join(dest, "%s.tgz" % package_name)

os.makedirs(dest, exist_ok=True)

tar = None

try:

print("Installing to %s" % dest)
tar = tarfile.open(package_local_path, "r:gz")
for member in tar.getmembers():
if member.name == package_name:
# Skip the root directory.
continue
member.name = os.path.relpath(member.name, package_name + os.path.sep)
tar.extract(member, dest)
return
except Exception:
print("Failed to open TAR")
traceback.print_exc()
rmtree(dest, ignore_errors=True)
finally:
if tar is not None:
tar.close()
if os.path.exists(package_local_path):
os.remove(package_local_path)

raise IOError("Unable to run INSTALL")
2 changes: 1 addition & 1 deletion python/phases/assessModel.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
from python.api.zingg.zingg import *
from zingg import *
import pandas as pd
import seaborn as sn
import matplotlib.pyplot as plt
Expand Down
2 changes: 1 addition & 1 deletion python/phases/exportModel.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

from python.api.zingg.zingg import *
from zingg import *
import sys
import argparse
import os
Expand Down
36 changes: 0 additions & 36 deletions python/pom.xml

This file was deleted.

5 changes: 5 additions & 0 deletions python/setup.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[bdist_wheel]
universal = 1

[metadata]
description-file = README.md
Loading

0 comments on commit a806efa

Please sign in to comment.