Tag Archives: python

Python and D-ISAM

date hate app
gratis natdejting norge quiz
new site de rencontre gratuit
free sites like chatroulette
rencontres amoureuses 06
dejtingapp utan facebook
top 100 single charts germany 2015
latest free european dating sites
joyeux anniversaire de rencontre mon amour
lieu de rencontre bruxelles
dejting for unga under 18 oktober
gratis dejtingsidor 2015 vecka
women's christian chat
dejtingsida utan medlemskap pris
dejtingsida for unga under 18
cerco uomo da sposare
storsta dejtingsajt badoo
kinderhotel osterreich single mit kind
bra dejtingsajt badoo
new music singles march 2015
site de rencontre serieuse gratuit
msn dejting se telefonnummer
annunci donne cerca uomo roma
watch movies online free blind dating
rencontre sexe bethune
vilken dejtingsajt ar bast film
rencontre sobre
rencontres if insa lyon
conjuguer se rencontrer
facebook smiley chat codes 2013
site rencontre ado toulouse
donne incontri sassari
jetzt spielen kostenlos ohne anmeldung
incontri senza iscrizioni
incontri a torino
incontro tifosi napoli borussia
dejting handikapp cykel
natdejting undersokning fragor
free online dating sites ireland
dejta 16 aring ha
annunci donna bari
partnersuche deutschlandsberg
roma incontri donne
free dating service in orlando fl
catholic singles las vegas nv
natdejting exempel cv
natdejting bra eller daligt batteri
rencontre en ligne film complet
neue email adresse kostenlos hotmail
best things to do in san diego for adults
nigerian christian singles dating site
pour tes beaux yeux site de rencontre
best dating sites christian
online dating rituals of the american male imdb
catania donna adulti
donna orientale cerca uomo torino
online dating writing email
free dating site in zambia
ragazze in chat gratis senza registrazione
donna cerca uomo roma
dejt 6
dejtingsidor vanner youtube
rencontres ecolo
most popular online dating uk
dejta asiatiska kvinnor i sverige
dejtingsidor kk forhallande
siti per incontrare ragazze di 15 anni
site de rencontre palestine
free international voice chat rooms
top dejtingsidor
natdejting motesplatsen mobile
dejtingsidor for under 18
dating sites for australian singles
roliga aktiviteter date
siti x singles
jeu 3d rencontres
prostitute rape survivors stories/articles
donne cerca donne
dejt i helsingborg
rencontre entre solitaire
match date for prom
dejtingsida for ensamstaende
cerco donna per coppia
site rencontre seniors
donne single chat gratis
natdejting bocker immobilien
rencontre dans un hotel
trovare anima gemella gratis
annonces algerie rencontres
feuerflamme de partnersuche
sito dating gratuito
date book definition
juegos gratis de encontrar objetos ocultos para adultos
free dating in peterborough
peut on stationner dans une zone de rencontre
m6 replay zita dans la peau d’une prostituee
how do i turn off facebook chat on my mobile
comparis kostenlos inserieren
rencontres pour l’emploi perpignan
online dating italia
test singleborsen kostenlos xp
incontri per adulti gallarate
donne sfigate amore
rencontrer tiken jah fakoly
partnersuche friendscout24 testen
rencontre lac de saint cassien
beatrice doyenne des prostituees de nancy
rencontres femmes dans la drome
russian dating websites free
natdejting 20 ar oskuld
chat dating schweiz
online partnervermittlung kostenlos fur frauen
maison jeunes cafe rencontre
natdejtingsidor
chat gratis piu usate
dejting passagen berlin
rencontre sidi bouzid
rencontres internationales mort imminente
dejta via telefon tips
single charts top 100 januar 2013
chattare senza registrazione gratis
les rencontres d’arles affiche
rencontre ski
lycee agricole la lande de la rencontre
dejt i stockholm quality
chat room christian singles
gay dating site new zealand
site de rencontre chou
rencontre entre beaux parents
skriva profil pa dejtingsida
waplog chat dating meet friend
dejta en kandis dod
je hate de vous rencontrer
facebook single kassel
dejtingsida usa chords
skapa egen dejtingsida exempel
date ios 7 release
meet singles in dar es salaam
dejta killar i usa
rencontre deja en couple
dejtingsidor for gifta personer
siti per incontri gratuiti
dejting tv program svt
dejta en nyskild man
dejtingsajter for unga gratis ziehen
gratis dejtingsajter sverige se
chat gratis buenos aires mayores de 40
dejta en kille med barn
natdejting 20 ar brollop
rencontre femme arras
dejting gavle jobb
singles aus der umgebung kennenlernen
femme belfort
dejtingsida asiater vitser
prostituees calais
donne brescia bakeca
dejtingsidor stockholm
donne ravenna incontri
meet agen
luoghi di incontro per single ladies
chats apps iphone
bakeca annunci alessandria
incontri donna foggia
faire des rencontres sur chatroulette
fare l amore in gravidanza al nono mese
site de rencontre en belgique sans abonnement
russia free dating site
come si fa l amore da dietro
windows a rencontre un probleme de disque dur
dejtingsajt anvandarnamn
siti gratuiti di incontri
dejtingsidor ligga ordsprak
dejt 60 lander
singleborsen online
donne cerca uomo monza
siti di incontro online gratis senza registrazione online
fare un sito web
katzen kostenlos registrieren
incontri con cougar
prostituees ouaga
dna.annonces.net rencontres
what is online speed dating
rencontre internationale de lurs
free online best chat room in india
top 5 sites rencontre
rencontres dans le tarn
natdejting 2013 creteil
basta dejtingsidan flashback konto
dimenticare un amore finito frasi
rencontre thoissey
rencontre femme aulnoye aymeries
dejta justin bieber spel online
svenska dejting appar xperia
welche partnerborse ist am besten ausgebaut
chat on line gratis
rencontre ligne 4
giorgio nardone gli errori delle donne in amore libro
best places to live in los angeles for singles
what's the best free dating site besides pof
dejt tips hora av sig
sites de rencontres gratuits en corse
femme saint lo
grille de rencontre
comment rencontrer sarko et zelko
online avatar chat games
free dating site in glasgow
dejtingsidor for bonder praster
dejting appar gratis yrkesutbildningar
meilleur site de rencontre smartphone
kann man zwei frauen gleich lieben
rencontre francophone toronto
siti di incontro gratis senza registrazione kindle
senioren singleborsen
la rencontre jean francois maurice & maryse tlumaczenie
cerco ragazza italiana
innamorarsi di un uomo divorziato con figli
dejtat i 3 manader
natdejting samtalsamnen middag
internationale singleborsen vergleich
incontrare donne straniere in italia
si puo fare l amore al primo mese di gravidanza
rencontre tarifee quimper
dejting pa internet otrohet
victor reny rencontres
la belle rencontre male
dejtingsidor happypancake norge
kann man zwei frauen gleichzeitig lieben
quando si e incinta si ha voglia di fare l amore
dejtingsajt for funktionshindrade stockholm
dejtingsajt anvandarnamn router
annuaire site de rencontre gratuit
miglior sito per conoscere ragazze
rencontre musicale savoie
dejtingsida for raggare lyrics
sito di chat
dejta natet billigt
free online dating sites sydney
rencontre comorienne france
site de rencontre totalement gratuit 2013
komplett kostenlos frauen kennenlernen
annunci per adulti massa carrara orari
prostituees sur autoroute
free web based chat programs
amore di chat.net
online girl dating sim games
gand belgique prostituee
gunstige reisen fur single mit kind
dejta 4 manader utveckling
annunci personali a novara
la rencontre imprevue libretto
rencontre serieuse maurice
incontri annunci milano
meilleur site rencontre payant
online christian dating sites in kenya
dejta lange jobba
natdejting beroende
partnersuche de app beenden
chat amore senza registrazione marchio
free live phone chat singles
bakeca annunci adulti
helt gratis date
quali sono le migliori chatroulette per adulti
dejtingsajt etnisk kjole
dejtingsajt kriminella politiker
dejtingsajt 50 plus beurs
tuttoannunci donna cerca uomo
best online dating websites usa
rencontres hommes nice
rysk dejtingsida
siti per incontrare ragazzi gratis
seriosa dejtingsidor gratis ziehen
rekommenderade dejtingsajter flashback
dating app iphone kostenlos
dejta bisexuell outing
meet indian singles nyc
judiska dejtingsajter finland
match date range vba
site de rencontre par geolocalisation
date app hong kong
bakeca annunci ravenna
dejting 18 ar dikt
nanna johansson natdejting flashback
lieu de rencontre toulouse
bravo online dating marcus
uomo cerca donna udine
prostituee a aix
gratis dejting telefon
site de rencontres dans les ardennes
dejting appar till iphone
citation nouvelle rencontre amitie
come incontrare donne russe
best free online dating sites 2014
nya dejting appar
donne roma incontri
hotel des rencontres severes pdf
siti di incontro online gratis senza registrazione
blois rencontres
site de rencontre love de toi
uomo cerca donne
greek singles dating melbourne
over 50 singles holidays
chat incontriamoci senza registrazione kindle
best dating sites singles over 50
dejtingsida test
prov di vicenza
ich suche ne frau
incontrissimi chat gratis senza registrazione lombardia
sito chat gratis italiano
free international dating sites usa
rhein zeitung koblenz partnersuche
online dating free asian
site de rencontre belge non payant
tier kleinanzeigen kostenlos aufgeben
hancock rencontre ace
american dating a german
rencontre en malaisie
cannapower top 100 single charts deutschland
association rencontre et loisirs lille
thai holiday date
poemes notre rencontre
etudiantes prostituee le havre
corsi fotografia monza
natdejta som ung
impots des prostituees
online dating website username
chat zaragoza gratis sin java
syriansk dejtingsida gratis
kristen dejting gratis online
mont dore rencontre musicales
application rencontre iphone montreal
dejting happy pancake english
endroit calme pour rencontre
annonce rencontre dna
incontro donne torino
quando un uomo con la pistola incontra un uomo con la biro
vetenskapens varld natdejting exempel
dejtingsajter sport fotboll
prostituee de luxe sur paris
dejtingsajter helt gratis antivirus
rencontre st georges beauce
donna cerca uomo padova
maxi rencontres
gameboy advance dating sim
date match barrage coupe du monde 2014
chat amore senza registrazione kik
rencontre preval et obama
7 himlen dejting regler
bloccare siti per adulti ipad
dejtingsidor goteborg
rencontre gratuite (service de rencontres gratuit et
question pour une nouvelle rencontre
siti di incontro per giovani werther
ragazze single chat
free online dating no hidden charges
chat senza registrazione per ragazzi
dejtingsidor under 18 oktober
veranstaltungen fur singles in dusseldorf
lily rose prostituee
annunci incontri a bologna
filipina singles dating and chat
partnersuche kostenlos in sachsen
rencontre avec marina abramovic
annonce gratuite rencontre femme homme
date outfit blog
gratis dejtingsidor i sverige se
dejta oskuld tjej
dejtingsidor ligga med
rencontre aire de phalempin
basta natdejting nackdelar
rencontres barcelone espagne
donne single cagliari
singleborse in facebook
online dating sites free london
dating sites for kenyan singles
wife dating sites uk
dejting appar till iphone halsa
100 free chat room phone numbers for fort worth
annunci cerco amici
partnersuche halle saale stadt
cougar dating website 100 free
what is the best free dating site for seniors
incontri in toscana
online dating profile photo tips
poeme premier jour notre rencontre
hate te rencontrer
best free english dating sites
gratis dejting for unga jobb
online chat for singles
best android app games for adults
dating site in vancouver bc
uk free dating sites review
groupe de rencontres friends
100 percent free dating site in france
siti gratis per incontrare single
dejta via sms biljetter
dejta ensamstaende mamma dejta
bakeca adulti milano
rencontre femme sur gmail
donne lucane in cerca di amore
rencontre dans le ter

D-ISAM Python module

This Python module imports D-ISAM as a shared library, and exports three classes.

d7 class exports the D-ISAM library itself, and adds “constant” values for the standard ISAM defines – for example d7.isOpen( "myfile", d7.ISINOUT + d7.ISAUTOLOCK )

d7error is a python Exception class, for example raise d7error( isam, "message text" )

d7key is a ctypes Structure class, and provides an instance of an ISAM key descriptor.

An example of usage can be found here

An overview is available here

Download the module here

#!/bin/python

from ctypes import CDLL, Structure, c_void_p, c_char_p, c_int, c_short, c_uint

d7 = CDLL( "libdisam72.so" )

# disam 'constant' values

d7.ISMAXPARTS = 20
d7.ISINPUT = 0x00
d7.ISOUTPUT = 0x01
d7.ISINOUT = 0x02
d7.ISTRANS = 0x04
d7.ISNOLOG = 0x08
d7.ISFIXLEN = 0x00
d7.ISVARLEN = 0x10
d7.ISVARCMP = 0x30
d7.ISSYNCWR = 0x40
d7.ISMASKED = 0x80
d7.ISNOCARE = 0x8000
d7.ISRDONLY = 0x100
d7.ISAUTOLOCK = 0x200
d7.ISMANULOCK = 0x400
d7.ISEXCLLOCK = 0x800
d7.ISSEMILOCK = 0x1000
d7.ISFIRST = 0
d7.ISLAST = 1
d7.ISNEXT = 2
d7.ISPREV = 3
d7.ISCURR = 4
d7.ISEQUAL = 5
d7.ISGREAT = 6
d7.ISGTEQ = 7
d7.CHARTYPE = 0
d7.DECIMALTYPE = 0
d7.INTTYPE = 1
d7.LONGTYPE = 2
d7.DOUBLETYPE = 3
d7.FLOATTYPE = 4
d7.MINTTYPE = 5
d7.MLONGTYPE = 6
d7.STRINGTYPE = 7
d7.ISDESC = 0x80
d7.CHARSIZE = 1
d7.INTSIZE = 2
d7.LONGSIZE = 4
d7.DOUBLESIZE = 8
d7.FLOATSIZE = 4
d7.MINTSIZE = 2
d7.MLONGSIZE = 4
d7.STRINGSIZE = 1
d7.ISNODUPS = 0x00
d7.ISDUPS = 0x01
d7.DCOMPRESS = 0x02
d7.LCOMPRESS = 0x04
d7.TCOMPRESS = 0x08
d7.COMPRESS = 0x0E
d7.TNULL = 0x10
d7.NULLKEY = 0x20
d7.ISLOCK = 0x100
d7.ISSKIPLOCK = 0x200
d7.ISWAIT = 0x400
d7.ISLCKW = 0x500
d7.ISKEEPLOCK = 0x800
d7.AUDSETNAME = 0
d7.AUDGETNAME = 1
d7.AUDSTART = 2
d7.AUDSTOP = 3
d7.AUDINFO = 4
d7.USERINFOSIZE = 10

# disam functions return and argument definitions

d7.isIndexInfo.restype = c_int
d7.isIndexInfo.argtypes = [ c_void_p, c_void_p, c_int ]

d7.isIsamInfo.restype = c_int
d7.isIsamInfo.argtypes = [ c_void_p, c_void_p ]

d7.isErase.restype = c_int
d7.isErase.argtypes = [ c_char_p ]

d7.isRename.restype = c_int
d7.isRename.argtypes = [ c_char_p, c_char_p ]

d7.isCluster.restype = c_void_p
d7.isCluster.argtypes = [ c_void_p, c_void_p ]

d7.isClone.restype = c_void_p
d7.isClone.argtypes = [ c_void_p, c_char_p ]

d7.isCopy.restype = c_int
d7.isCopy.argtypes = [ c_void_p, c_void_p, c_void_p ]

d7.isBuild.restype = c_void_p
d7.isBuild.argtypes = [ c_char_p, c_int, c_int, c_void_p, c_int ]

d7.isPrecious.restype = c_int
d7.isPrecious.argtypes = [ c_void_p, c_int ]

d7.isAddIndex.restype = c_int
d7.isAddIndex.argtypes = [ c_void_p, c_void_p ]

d7.isDelIndex.restype = c_int
d7.isDelIndex.argtypes = [ c_void_p, c_void_p ]

d7.isUserInfo.restype = c_int
d7.isUserInfo.argtypes = [ c_void_p, c_int, c_char_p ]

d7.isOpen.restype = c_void_p
d7.isOpen.argtypes = [ c_char_p, c_int ]

d7.isClose.restype = c_int
d7.isClose.argtypes = [ c_void_p ]

d7.isLockCheck.restype = c_int
d7.isLockCheck.argtypes = [ c_void_p, c_int ]

d7.isSetMode.restype = c_int
d7.isSetMode.argtypes = [ c_void_p, c_int ]

d7.isWrite.restype = c_int
d7.isWrite.argtypes = [ c_void_p, c_void_p ]

d7.isWrLock.restype = c_int
d7.isWrLock.argtypes = [ c_void_p, c_void_p ]

d7.isWrCurr.restype = c_int
d7.isWrCurr.argtypes = [ c_void_p, c_void_p ]

d7.isRewrite.restype = c_int
d7.isRewrite.argtypes = [ c_void_p, c_void_p ]

d7.isRewCurr.restype = c_int
d7.isRewCurr.argtypes = [ c_void_p, c_void_p ]

d7.isRewRec.restype = c_int
d7.isRewRec.argtypes = [ c_void_p, c_uint, c_void_p ]

d7.isRewNxt.restype = c_int
d7.isRewNxt.argtypes = [ c_void_p, c_void_p ]

d7.isRead.restype = c_int
d7.isRead.argtypes = [ c_void_p, c_void_p, c_int ]

d7.isStart.restype = c_int
d7.isStart.argtypes = [ c_void_p, c_void_p, c_int, c_void_p, c_int ]

d7.isIndex.restype = c_int
d7.isIndex.argtypes = [ c_void_p, c_int ]

d7.isGoto.restype = c_int
d7.isGoto.argtypes = [ c_void_p, c_uint ]

d7.isPush.restype = c_int
d7.isPush.argtypes = [ c_void_p, c_void_p, c_void_p ]

d7.isPop.restype = c_int
d7.isPop.argtypes = [ c_void_p, c_int, c_uint ]

d7.isData.restype = c_int
d7.isData.argtypes = [ c_void_p, c_void_p, c_uint ]

d7.isLock.restype = c_int
d7.isLock.argtypes = [ c_void_p ]

d7.isUnLock.restype = c_int
d7.isUnLock.argtypes = [ c_void_p ]

d7.isRelease.restype = c_int
d7.isRelease.argtypes = [ c_void_p ]

d7.isRelRec.restype = c_int
d7.isRelRec.argtypes = [ c_void_p, c_uint ]

d7.isRelCurr.restype = c_int
d7.isRelCurr.argtypes = [ c_void_p ]

d7.isDelete.restype = c_int
d7.isDelete.argtypes = [ c_void_p, c_void_p ]

d7.isDelCurr.restype = c_int
d7.isDelCurr.argtypes = [ c_void_p ]

d7.isDelRec.restype = c_int
d7.isDelRec.argtypes = [ c_void_p, c_uint ]

d7.isErrno.restype = c_int
d7.isErrno.argtypes = [ c_void_p ]

d7.isErrio.restype = c_int
d7.isErrio.argtypes = [ c_void_p ]

d7.isCount.restype = c_int
d7.isCount.argtypes = [ c_void_p ]

d7.isRecnum.restype = c_int
d7.isRecnum.argtypes = [ c_void_p ]

d7.isReclen.restype = c_int
d7.isReclen.argtypes = [ c_void_p ]

d7.isSetrec.restype = c_int
d7.isSetrec.argtypes = [ c_void_p, c_uint ]

d7.isSetlen.restype = c_int
d7.isSetlen.argtypes = [ c_void_p, c_short ]

d7.isLdSchema.restype = c_int
d7.isLdSchema.argtypes = [ c_void_p, c_char_p ]

d7.isDpSchema.restype = c_int
d7.isDpSchema.argtypes = [ c_void_p ]

d7.isStSchema.restype = c_int
d7.isStSchema.argtypes = [ c_void_p, c_char_p ]

d7.isRmSchema.restype = c_int
d7.isRmSchema.argtypes = [ c_void_p ]

d7.isSetUnique.restype = c_int
d7.isSetUnique.argtypes = [ c_void_p, c_uint ]

d7.isUniqueId.restype = c_int
d7.isUniqueId.argtypes = [ c_void_p, c_void_p ]

d7.isGetLastRec.restype = c_int
d7.isGetLastRec.argtypes = [ c_void_p, c_void_p ]

d7.isSetLastRec.restype = c_int
d7.isSetLastRec.argtypes = [ c_void_p, c_uint ]

d7.isLastRec.restype = c_int
d7.isLastRec.argtypes = [ c_void_p, c_void_p ]

d7.isAmSane.restype = c_int
d7.isAmSane.argtypes = [ ]

d7.isCheckData.restype = c_int
d7.isCheckData.argtypes = [ c_void_p ]

d7.isCheckIndex.restype = c_int
d7.isCheckIndex.argtypes = [ c_void_p, c_int ]

d7.isRebuildFree.restype = c_int
d7.isRebuildFree.argtypes = [ c_void_p, c_int ]

d7.isRebuildIdx.restype = c_int
d7.isRebuildIdx.argtypes = [ c_void_p, c_int ]

d7.isCheckVarlen.restype = c_int
d7.isCheckVarlen.argtypes = [ c_void_p, c_void_p ]

class d7error(Exception):

  def __init__ ( self, isam, string ):
    self.value = d7.isErrno( isam ) 
    self.string = string;

  def __str__ ( self ):
    return repr( "[%s] %s" % ( self.value, self.string ) )


class _d7_key_part(Structure):
  _fields_ = [ ("kp_start", c_short),
               ("kp_leng", c_short),
               ("kp_type", c_short) ]

class d7key(Structure):
  _fields_ = [ ("k_flags", c_short),
               ("k_nparts", c_short),
               ("k_part", _d7_key_part * d7.ISMAXPARTS) ]

D-ISAM example in Python

The following example code demonstrates the basic principles of using D-ISAM in Python, by means of the standard ctypes library.

The required disam72 class module is here

An overview is available here

Download the example here

#!/usr/bin/python

from ctypes import *
from disam72 import d7, d7key, d7error

name = "example_isam_file"

class RECORD(Structure):
  _fields_ = [ ( "code", c_int ),
               ( "name", c_char * 31 ) ]

key1 = d7key( d7.ISNODUPS, 1, ( ( 0, 4, d7.LONGTYPE ), ) )

key2 = d7key( d7.COMPRESS + d7.TNULL, 1, ( ( 4, 31, d7.STRINGTYPE ), ) )

d7.iserase( name )

isam = d7.isBuild( name, 35, 0, byref(key1), d7.ISINOUT + d7.ISMANULOCK )
if isam is None:
  raise d7error( None, "build %s failed" % name )

if d7.isAddIndex( isam, byref(key2) ) == 0:
  raise d7error( isam, "add second index failed" );

pad = RECORD( 0, "" )

pad.code = 1
pad.name = "banana, junior"
if d7.isWrite( isam, byref(pad) ) == 0:
  raise d7error( isam, "add %d %s failed" % ( pad.code, pad.name ) )

pad.code = 2
pad.name = "apple, macintosh"
if d7.isWrite( isam, byref(pad) ) == 0:
  raise d7error( isam, "add %d %s failed" % ( pad.code, pad.name ) )

pad.code = 999
pad.name = "error, read failed"

if d7.isRead( isam, byref(pad), d7.ISFIRST ) == 0:
  raise d7error( isam, "read first on primary index failed" )
else:
  print "%d: %s" % ( pad.code, pad.name )

if d7.isStart( isam, byref(key2), 1, isam, d7.ISFIRST ) == 0:
  raise d7error( isam, "switch to secondary index failed" );

if d7.isRead( isam, byref(pad), d7.ISFIRST ) == 0:
  raise d7error( isam, "read first on secondary index failed" )
else:
  print "%d: %s" % ( pad.code, pad.name )

result:

1: banana, junior
2: apple, macintosh