Skip to content

Instantly share code, notes, and snippets.

View jamilatta's full-sized avatar
🏠
Working from home

Jamil Atta Junior jamilatta

🏠
Working from home
View GitHub Profile
#coding: utf-8
import itertools
import zipfile
import xml.etree.cElementTree as etree
class SPSMixin(object):
@property
def xmls(self):
@jamilatta
jamilatta / gateway_server.py
Last active December 22, 2015 11:08
Prova de conceito do Gateway HTTP - Pyramid.
from pyramid.response import Response
from pyramid.config import Configurator
from wsgiref.simple_server import make_server
from pyramid.httpexceptions import HTTPNotFound
from pyramid.view import notfound_view_config, view_config
from sqlalchemy.orm.exc import NoResultFound
import utils
import models
@jamilatta
jamilatta / socket_client.py
Last active December 29, 2015 02:59
Example of client and server socket in python.
#!/usr/bin/python
import socket
import os, os.path
print "Connecting..."
if os.path.exists('./example.sock'):
client = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
client.connect('./example.sock')
@jamilatta
jamilatta / editorialmanager.models
Created September 8, 2014 19:57
Editorial Manager models
#coding: utf-8
from django.db import models
from django.utils.translation import ugettext_lazy as _
from journalmanager.models import Issue
class EditorialBoard(models.Model):
"""
# coding: utf-8
import factory
from editorialmanager import models
from journalmanager.tests.modelfactories import IssueFactory
class EditorialBoardFactory(factory.Factory):
FACTORY_FOR = models.EditorialBoard
{
"took" : 14,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
@jamilatta
jamilatta / icatman.mapping
Created January 27, 2015 18:27
Mappnig of icatman index
DELETE /icatman
PUT /icatman
PUT /icatman/article/_mapping
{
"article" : {
"_timestamp" : {
"enabled" : true,
"store" : true
@jamilatta
jamilatta / 0061_journalmanager_migration
Created February 25, 2015 20:47
0061_journalmanager_migration
# -*- coding: utf-8 -*-
from south.utils import datetime_utils as datetime
from south.db import db
from south.v2 import SchemaMigration
from django.db import models
class Migration(SchemaMigration):
def forwards(self, orm):
@jamilatta
jamilatta / cutus.py
Last active September 21, 2015 19:09
Script to pick up the growth of articles and issues in 2005 to 2016 (SciELO BR).
# coding: utf-8
import requests
from lxml import html
ISSN_URL = "http://articlemeta.scielo.org/api/v1/journal/identifiers/?collection=scl"
STATBILIO_URL = "http://statbiblio.scielo.org//stat_biblio/index.php?state=15&lang=en&country=scl&issn=ISSN&CITED[]=ISSN&YNG[]=YEAR"
YEARS = range(2005, 2016)
@jamilatta
jamilatta / pending_graph.py
Last active October 5, 2015 20:59
Grafo de dependências de requisitos funcionais (Projeto Site)
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import absolute_import
from __future__ import unicode_literals
from __future__ import print_function
from __future__ import division
import pygraphviz as pgv