Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
gargantext
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
humanities
gargantext
Commits
c0f5f35e
Commit
c0f5f35e
authored
Aug 11, 2017
by
sim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[CLEAN] pyflakes & other cleaning
parent
fc33b3c8
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
22 deletions
+12
-22
gargantext_notebook.py
install/notebook/gargantext_notebook.py
+12
-22
No files found.
install/notebook/gargantext_notebook.py
View file @
c0f5f35e
#!/usr/bin/env python
"""
Gargantext Software Copyright (c) 2016-2017 CNRS ISC-PIF -
http://iscpif.fr
...
...
@@ -6,40 +7,26 @@ http://gitlab.iscpif.fr/humanities/gargantext/blob/stable/LICENSE )
- In France : a CECILL variant affero compliant
- GNU aGPLV3 for all other countries
"""
#!/usr/bin/env python
import
os
import
os
import
django
# Django settings
dirname
=
os
.
path
.
dirname
(
os
.
path
.
realpath
(
__file__
))
os
.
environ
.
setdefault
(
"DJANGO_SETTINGS_MODULE"
,
"gargantext.settings"
)
os
.
environ
.
setdefault
(
'DJANGO_SETTINGS_MODULE'
,
'gargantext.settings'
)
django
.
setup
()
# initialize Django application
from
django.core.wsgi
import
get_wsgi_application
application
=
get_wsgi_application
()
from
gargantext.models
import
ProjectNode
,
DocumentNode
from
gargantext.util.db
import
session
,
get_engine
from
collections
import
Counter
from
gargantext.util.db
import
*
from
gargantext.util.toolchain.main
import
parse_extract_indexhyperdata
from
nltk.tokenize
import
wordpunct_tokenize
from
gargantext.models
import
*
from
nltk.tokenize
import
word_tokenize
import
nltk
as
nltk
from
statistics
import
mean
from
math
import
log
from
collections
import
defaultdict
import
matplotlib.pyplot
as
plt
import
numpy
as
np
import
datetime
from
collections
import
Counter
from
langdetect
import
detect
as
detect_lang
def
documents
(
corpus_id
):
return
(
session
.
query
(
DocumentNode
)
.
filter_by
(
parent_id
=
corpus_id
)
#.order_by(Node.hyperdata['publication_date'])
.
all
())
#import seaborn as sns
import
pandas
as
pd
...
...
@@ -49,11 +36,14 @@ def chart(docs, field):
frame1
=
pd
.
DataFrame
(
year_publis
,
columns
=
[
'Date'
,
'DateValue'
],
index
=
frame0
.
Date
)
return
frame1
from
gargantext.util.crawlers.HAL
import
HalCrawler
def
scan_hal
(
request
):
hal
=
HalCrawler
()
return
hal
.
scan_results
(
request
)
def
scan_gargantext
(
corpus_id
,
lang
,
request
):
connection
=
get_engine
()
.
connect
()
# TODO add some sugar the request (ideally request should be the same for hal and garg)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment