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
d75224b7
Commit
d75224b7
authored
Aug 11, 2017
by
sim
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[REFACT] Minor refactor
parent
de5325cb
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
11 deletions
+4
-11
gargantext_notebook.py
install/notebook/gargantext_notebook.py
+4
-11
No files found.
install/notebook/gargantext_notebook.py
View file @
d75224b7
...
...
@@ -7,7 +7,6 @@ http://gitlab.iscpif.fr/humanities/gargantext/blob/stable/LICENSE )
- GNU aGPLV3 for all other countries
"""
#!/usr/bin/env python
import
sys
import
os
...
...
@@ -19,9 +18,7 @@ os.environ.setdefault("DJANGO_SETTINGS_MODULE", "gargantext.settings")
from
django.core.wsgi
import
get_wsgi_application
application
=
get_wsgi_application
()
from
gargantext.util.toolchain.main
import
parse_extract_indexhyperdata
from
gargantext.util.db
import
*
from
gargantext.models
import
Node
from
gargantext.util.toolchain.main
import
parse_extract_indexhyperdata
from
nltk.tokenize
import
wordpunct_tokenize
...
...
@@ -39,13 +36,9 @@ from collections import Counter
from
langdetect
import
detect
as
detect_lang
def
documents
(
corpus_id
):
return
(
session
.
query
(
Node
)
.
filter
(
Node
.
parent_id
==
corpus_id
,
Node
.
typename
==
"DOCUMENT"
)
# .order_by(Node.hyperdata['publication_date'])
.
all
()
)
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
...
...
@@ -77,7 +70,7 @@ def myProject_fromUrl(url):
myProject :: String -> Project
"""
project_id
=
url
.
split
(
"/"
)[
4
]
project
=
session
.
query
(
Node
)
.
filter
(
Node
.
id
==
project_id
)
.
first
(
)
project
=
session
.
query
(
ProjectNode
)
.
get
(
project_id
)
return
project
...
...
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